So here I have a java program that manipulates a huge amount of data and stores it in objects (mainly hash maps). At some point in time, the data becomes useless, and I need to refuse so that I can free some memory.
My question is, what would be the best behavior to discard this data for garbage collection?
I tried map.clear (), however this is not enough to clear the memory allocated by the map.
EDIT (To add alternatives I tried)
I also tried system.gc () to get the garbage collector to start, however it didn't help
source
share