Forcing deallocation of large cache object in Java
        Posted  
        
            by Jack
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Jack
        
        
        
        Published on 2010-03-09T02:56:17Z
        Indexed on 
            2010/03/09
            3:06 UTC
        
        
        Read the original article
        Hit count: 341
        
java
|garbage-collection
I use a large (millions) entries hashmap to cache values needed by an algorithm, the key is a combination of two objects as a long. Since it grows continuously (because keys in the map changes, so old ones are not needed anymore) it would be nice to be able to force wiping all the data contained in it and start again during the execution, is there a way to do effectively in Java?
I mean release the associated memory (about 1-1.5gb of hashmap) and restart from the empty hashmap..
© Stack Overflow or respective owner