Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • 1
    static has nothing to do with why the map is not getting GC'ed. stackoverflow.com/questions/1353309/… Commented Apr 15, 2013 at 17:51
  • I'd half suspect that map just won't get GC'd until that memory is needed for something else. Commented Apr 15, 2013 at 17:52
  • Yes, but I'm having OutOfMemoryError so memory is indeed needed. Commented Apr 15, 2013 at 17:54
  • At which line is the OutOfMemoryError occuring? In doSomeCode() or before? Commented Apr 15, 2013 at 18:07
  • Inside doSomeCode() when I try to create more objects on the Heap. Commented Apr 15, 2013 at 18:08