Pratik,


> -----Original Message-----
> From: pratik.kulka...@shell.com.INVALID
> <pratik.kulka...@shell.com.INVALID>
> Sent: Thursday, April 13, 2023 4:36 AM
> To: users@tomcat.apache.org
> Subject: Java Heap Space Error
> 
> Hello,
> 
> This email concerns an error I encountered while using Oracle Apex with
> ORDS 3.0.9 and Tomcat 9. Specifically, I receive a "Java heap space" error
> when accessing the application.
> 
> To troubleshoot the issue, I have tried to increase the maximum heap size of
> the JVM using the -Xmx option in the CATALINA_OPTS environment variable.
> I set this environment variable in the catalina.bat file and restarted the
> Tomcat service, but the error persisted.
> 
> I have also confirmed that the CATALINA_OPTS environment variable is set
> correctly by running echo %CATALINA_OPTS% in the command prompt.
> 
> I should note that I have two versions of Tomcat installed on the system - 8.5
> and 9. Everything works fine on Tomcat 8.5, but the "Java heap space" errors
> are thrown on Tomcat 9.
> 
> I would appreciate any insights or guidance you can provide to help me
> resolve this issue. Below are the details of the software I am using,
> 
> 
>   *   Windows Server 2016 Datacenter
>   *   ORDS 3.0.9
>   *   Tomcat 9.0.73 (which is throwing the error)
>   *   Tomcat 8.5 (which works fine)
>   *   Java 1.8.0_361
> 
> Kind regards,
> Pratik Kulkarni

The most effective thing to do is take heap dumps.  If you enable 
-XX:HeapDumpOnOutOfMemoryError, you'll get one when the app crashes.  If you 
want to be more proactive, you can use jcmd to take them while the app is 
running.

Use something like Eclipse MAT to open the heap dump.  MAT will make some 
educated guesses about what might be the problem.  If that's not enough, look 
at the histogram.  Sometimes the problem will be obvious from a single dump.  
"Oh!  Why do I have 1.21GB of class Foo?"  Sometimes you'll need to take a 
couple of dumps at some interval and compare them.  In that case hopefully 
you'll see a particular class bubbling to the top of the histogram.  Then 
you'll need to figure out why those objects are being kept alive.  Right-click 
the offending class and choose "Merge shortest path to GC roots."  You can also 
choose "List Objects with incoming references."

john

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to