﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
257	Memory allocation error when lots of ram still available.	anonymous		"OS = WinXP SP2
RAM = 2.00Gb
AutoIt Ver = 3.2.11.12

I'm not sure if this is a bug or some limit of Window or AutoIt

Background:
I'm working with some large text files 200Gb to 400Gb and found that any of the file functions that use FileRead() generate an error, even though Task Manager shows plenty of memory left, in the form of a message box
Title = 'AutoIt'
Text  = 'Error allocating memory.'

I can work around this by processing the files line by line, but obviously this is much slower. 

Observations:
The help file give the theoretical limit 2147483647 characters but it would appear that it is impossible to get anywhere near this limit.

I created the scripts to try and find exactly what the limit is on my system. The results seem to show that the limit is some sort of global memory limit within AutoIt, rather than a limit for each string, as each time I double the number string variable filled the total memory used before the error allocating memory occurs is approximately the same.

Should AutoIt be able to make use of more of the memory available to it?

Script 1
{{{
#Include <String.au3>
Local $sString = _StringRepeat( ""A"", 1024)
Local $iCount = 0
Local $sTest1 =''

While 1
	$sTest1 &= $sString
	$iCount += 1	
	ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $iCount = ' & $iCount & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
WEnd
}}}

Script 2

{{{
#Include <String.au3>
Local $sString = _StringRepeat( ""A"", 1024)
Local $iCount = 0
Local $sTest1 =''
Local $sTest2 =''

While 1
	$sTest1 &= $sString
	$iCount += 1	
	ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $iCount = ' & $iCount & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
	$sTest2 &= $sString
	$iCount += 1	
	ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $iCount = ' & $iCount & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
WEnd
}}}

Script 3
{{{
#Include <String.au3>
Local $sString = _StringRepeat( ""A"", 1024)
Local $iCount = 0
Local $sTest1 =''
Local $sTest2 =''
Local $sTest3 =''
Local $sTest4 =''

While 1
	$sTest1 &= $sString
	$iCount += 1	
	ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $iCount = ' & $iCount & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
	$sTest2 &= $sString
	$iCount += 1	
	ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $iCount = ' & $iCount & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
	$sTest3 &= $sString
	$iCount += 1	
	ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $iCount = ' & $iCount & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
	$sTest4 &= $sString
	$iCount += 1	
	ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $iCount = ' & $iCount & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
WEnd
}}}

Maximum values of $iCount which equates to the size of the $sTextn
Script 1 = 262142Kb in 1 string
Script 2 = 262141Kb in 2 strings
Script 3 = 262139Kb in 4 strings"	Bug	closed		AutoIt	3.2.11.12	None	Wont Fix		
