I have a program that processes a bunch of csv files with many columns so that the user can pull out specific columns and write them to another csv file that's much smaller, and only contains what they require. Since there can be up to 8 million rows, I've created a queue system using a list, where it adds pieces(50000 lines at a time) to the list buffer so that the writer can write that piece, and then use listbuffer[i].clear();
to remove it, so that i am using much less memory, and also limit the buffer to only contain 10 items, keeping total memory use as low as i require it.
My problem is that thelistbuffer[i].clear();
is not letting go of the memory it previously used until the entire program is finished and I've reinitialized the buffer so that it is blank for the next use.
**listbuffer is aList<List<List<string>>>
Just so this makes a little more sense...
listbuffer[chunk of lines][row #][column #]
Is there a way to tell the list to let go of the memory that list[i]
is using?
Thanks!