F
Freddy Coal
Hi, I have an strange error;
I have a 200Mb txt file, for speed I try to load that in memory (my PC have
3Gb in Ram with Win XP 32Bit), my problem is trying to load that in an
string variable, I get the next error:
Exception of type 'System.OutOfMemoryException' was thrown.
My question is if the memory limit for the string is 2^31 (2.147.483.647
more than 2Gb) why I can get that error when try to load a file of less than
the theorical limit of the 32bit operating system.
For read the file I'm using the next code:
Dim Lector As New StreamReader(Path_File, True)
Dim Cadena as string
Cadena = Lector.ReadToEnd
In the moment I read the file line by line, but this process is very slow,
because I need process each line instead of all the block (for example for
remove quotes or get data with Regex), if I can load all the file, I can
apply regex for make multiples process.
Thanks in advance for any help.
Freddy Coal
I have a 200Mb txt file, for speed I try to load that in memory (my PC have
3Gb in Ram with Win XP 32Bit), my problem is trying to load that in an
string variable, I get the next error:
Exception of type 'System.OutOfMemoryException' was thrown.
My question is if the memory limit for the string is 2^31 (2.147.483.647
more than 2Gb) why I can get that error when try to load a file of less than
the theorical limit of the 32bit operating system.
For read the file I'm using the next code:
Dim Lector As New StreamReader(Path_File, True)
Dim Cadena as string
Cadena = Lector.ReadToEnd
In the moment I read the file line by line, but this process is very slow,
because I need process each line instead of all the block (for example for
remove quotes or get data with Regex), if I can load all the file, I can
apply regex for make multiples process.
Thanks in advance for any help.
Freddy Coal