Strings and Memory
Posted: Wed May 19, 2004 9:20 pm
I am having problems with the memory used in a program that does a lot of string manipulation. The guts of the program works like:
string2=bit_modified(string1)
string1=""
string3=bit_modified(string2)
string2=""
string4=bit_modified(string3)
string3=""
.....and so on, doing this multiple times in a loop 7 bytes at a time.
I thought that by setting the strings to "" (and re-dimensioning arrays to 0 elements) once finished with, it would free up memory, but it seems to leave the memory used at the original string length, even after procedures have terminated.
by the time it has dealt with about 500k of data - my page file is in the region of 2Gb!
I'm sure this is a windows thing. Is there another way to clear trhe memory being used while a program is running?
string2=bit_modified(string1)
string1=""
string3=bit_modified(string2)
string2=""
string4=bit_modified(string3)
string3=""
.....and so on, doing this multiple times in a loop 7 bytes at a time.
I thought that by setting the strings to "" (and re-dimensioning arrays to 0 elements) once finished with, it would free up memory, but it seems to leave the memory used at the original string length, even after procedures have terminated.
by the time it has dealt with about 500k of data - my page file is in the region of 2Gb!
I'm sure this is a windows thing. Is there another way to clear trhe memory being used while a program is running?