I've been getting some java.lang.OutOfMemoryError: GC overhead limit exceeded errors while running my Java app overnight:
java.lang.OutOfMemoryError: Java heap space
Dumping heap to java_pid6376.hprof ...
Heap dump file created [512149941 bytes in 23.586 secs]
23:34:52,163 WARN  [HDScanner] Scan failed
java.lang.OutOfMemoryError: Java heap space
23:34:52,298 ERROR [ContainerBase] Exception invoking periodic operation: 
java.lang.OutOfMemoryError: Java heap space
23:34:52,321 ERROR [JIoEndpoint] Socket accept failed
java.lang.OutOfMemoryError: Java heap space
    at java.net.ServerSocket.accept(Unknown Source)
    at org.apache.tomcat.util.net.DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactory.java:61)
    at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:310)
If I open up jvisualvm, I can see that I am indeed out of heap space:

I'd like to profile it to try to figure out what's going on - is there a memory leak? etc. However, I'm unable to get the jvisualvm profiler to do anything at all. The Profiler tab shows a warning about class sharing being enabled:

...even though I've added the -Xshare:off flag to my VM args:
So,
- Any ideas about how to get profiling to work?
- Is it worth playing around with G1GCinstead of ...whatever GC I'm currently using?

 
     
     
    