Another question: My program exits with an "out of memory" failure.
I'm on linux, and I have ~ 8gb of ram on this computer. The program is parsing files in a directory, collecting all this info in a tree, and then generating from this tree. Now, the current folder is pretty big, almost 36,000 files.
How can I know what the culprit is? is it the design? so many objects in memory, or is it just a silly mistake
What are the usual tools you use to find where all this memory went to? Thanks!
Inject echo getOccupiedMem() into strategic places in your program.
Or maybe collect the information in a database.
Or maybe by not collecting everything into a single tree.
Usually there is a correlation between what you do and the amount of memory it requires, the more memory it takes, the more important it is and you don't want to live in this fragile world where you have a single process that loses all the work when it crashes. Some incremental approach can really work wonders here.