In our Tomcat application, we get an "OutOfMemoryError: GC overhead limit exceeded".
But Runtime.getRuntime().freeMemory()
reports 576 MB are free.
How can this happen?
The error is thrown from within the SQL Server JDBC driver, and I cannot imagine this would try to allocate hundreds of megabytes in one memory request.
And the GarbageCollectorMXBean
s counts for "PS Scavenge" as well as "PS MarkSweep" did not increase much in the minutes before the error was thrown.
Runtime.getRuntime().maxMemory()
as well as Runtime.getRuntime().totalMemory()
report 4.5 GB. This is running with the 64 bit Sun JVM for Java 7.