Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Clearing memory map of maps?

742450Dec 27 2010 — edited Dec 27 2010
Hi I have the following Class:

public class TestClass{

Map<String, Map<String, String>> aMap = new TreeMap<String, Map<String, String>>();

public void addStuff () {
//this adds things to aMap
}
public void clearMap() {
aMap = new TreeMap<String, Map<String, String>>();
}

}

Does my clearMap method make all memory used by this map ava. for garbage collection? What is the proper way to clear all memory to reset the aMap variable? Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 24 2011
Added on Dec 27 2010
4 comments
455 views