Java OutOfMemoryError – Sanity Check
By Adrian Sutton
Just for my sanity, before an OutOfMemoryError is thrown, the garbage collector should do everything it can to free up more memory right? What I’m seeing now is that the JVM does a partial GC, throws an OutOfMemoryError and then decides to actually do a full GC which frees up enough RAM to get things working again.
Very annoying and I’m not sure what I can do about it. There are definitely no remaining references, but I still can’t get that memory back.