Have looked around extensively but can't find a definitive answer to this: are objects created using Apachie POI HSSF reclaimed by the normal Java gc, or do I need to do something else?
I have a Java program that reads files of test data and writes xls files of data analysis. I've noticed that the working set size (as reported by Process Explorer) gets larger by about 3MB for each file processed, leading me to suspect that (despite explicit calls to gc), the POI objects (cells, rows, sheets) are not being reclaimed, even though there are no lingering pointers to them once each file is written.
I had not anticipated this, so the code currently creates new objects (cells, etc.) every time it needs one. One suggestion I have seen says to create the needed sheets, rows, cells once, then just keep setting new values in them before writing out each xls file. Will this in fact cut down on memory usage or does setting new values into cells also eat memory?
In case it matters, I'm using poi-3.9-20121203
I'm running into a problem because I've now got several thousand files to process and wind up with out of memory errors. (For various reasons it's much easier if I can do them all in one pass, instead of having to do say 500 at a time.)
Many thanks for any recommendations and/or suggestions.