Memory leak with BufferedFile?

Leon leonp at gmail.com
Sat Aug 27 16:00:07 PDT 2011


I'm writing a simple program which uses merge sort to sort very large text
files. I split the text file into several temporary files which are sorted and
merged together.

The trouble I'm having is that the BufferedFile class seems to have a memory
leak. The memory usage of the process slowly goes up until it throws an out of
memory exception. I can fix the memory leak by switching to the File class,
but that makes the program much slower.

Calling GC.collect() didn't help, and neither did explicitly deleting the
BufferedFile object.


More information about the Digitalmars-d-learn mailing list