title: how to clear objects (HashMap) to be garbage collected - Java
body: <p>So what I am having here is a java program the manipulates a huge amount of data and store it into objects (Mainly hash-maps). At some point of the running time the data becomes useless and I need to discard so I can free up some memory.</p>
  
  <p>My question is what would be the best behavior to discard these data to be garbage collected ?</p>
  
  <p>I have tried the map.clear(), however this is not enough to clear the memory allocated by the map. </p>
  
  <p><strong>EDIT</strong> (To add alternatives I have tried)</p>
  
  <p>I have also tried the system.gc() to force the garbage collector to run, however it did not help</p>