Our tomcat server threw out "java.lang.OutOfMemoryError: Java heap space", but the heap size in dump file is only 1.7GB, and the -Xmx is 4GB.
I'm not sure what's happened, could you help me?
Environment: Redhat tomcat6 jdk6
XmxSIZE
can be greater then Java core dump because OutOfMemory
happen when you try to allocate a large object!
Our application with -Xmx1000m
and 670 MiB dump crashed by OutOfMemory
on uploading 300 MiB attachment by a user.
We discover this in VisualVM in "Show Threads" trace on System.arrayCopy
. Reference from local stack frame variable point to 300 MiB byte array.
Now we limit attachment size and save our application from future crashes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With