You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Pr...@shell.com.INVALID on 2023/04/13 09:35:58 UTC

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


RE: Java Heap Space Error

Posted by Jo...@wellsfargo.com.INVALID.
Pratik,


> -----Original Message-----
> From: Pratik.Kulkarni@shell.com.INVALID
> <Pr...@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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Java Heap Space Error

Posted by Kevin Huntly <km...@gmail.com>.
Also, is it possible for you to post the heapdump (if one was generated?)
________________________________________________

Kevin Huntly
Email: kmhuntly@gmail.com
Cell: 716/424-3311
________________________________________________

-----BEGIN GEEK CODE BLOCK-----
Version: 1.0
GCS/IT d+ s a C++ UL+++$ P+(++) L+++ E---
W+++ N+ o K(+) w--- O- M-- V-- PS+ PE Y(+)
PGP++(+++) t+ 5-- X-- R+ tv+ b++  DI++ D++
G++ e(+) h--- r+++ y+++*
------END GEEK CODE BLOCK------


On Thu, Apr 13, 2023 at 6:30 AM Olaf Kock <to...@olafkock.de> wrote:

> Hi Pratik,
>
> On 13.04.23 11:35, Pratik.Kulkarni@shell.com.INVALID wrote:
> > 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,
>
> 1. Make sure you have enough memory available (my recommendation is to
> set -Xms to the same value as -Xmx, so that you see *immediately* (on
> startup) if you don't have enough memory available. It doesn't help if
> you need 3 hours or 3 days to run into this condition.
>
> 2. Check if your application has a memory leak (e.g. by monitoring the
> memory consumption over time)
>
> Olaf
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

Re: Java Heap Space Error

Posted by Olaf Kock <to...@olafkock.de>.
Hi Pratik,

On 13.04.23 11:35, Pratik.Kulkarni@shell.com.INVALID wrote:
> 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,

1. Make sure you have enough memory available (my recommendation is to 
set -Xms to the same value as -Xmx, so that you see *immediately* (on 
startup) if you don't have enough memory available. It doesn't help if 
you need 3 hours or 3 days to run into this condition.

2. Check if your application has a memory leak (e.g. by monitoring the 
memory consumption over time)

Olaf


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


RE: Java Heap Space Error

Posted by Pr...@shell.com.INVALID.
Hi John,

I don't think so, it returns around 50 rows. Also, this same application is working perfectly fine in Tomcat version 8.5, but it gives these errors on Tomcat 9.0.73.

Thanks,
Pratik

-----Original Message-----
From: John.E.Gregg@wellsfargo.com.INVALID <Jo...@wellsfargo.com.INVALID> 
Sent: Friday, April 14, 2023 09:00
To: users@tomcat.apache.org
Subject: Re: Java Heap Space Error

Think Secure. This email is from an external source.

Pratik,

You're getting the error when executing a DB query.  How many rows does it return?  Could it be returning too many rows?
________________________________


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


Re: Java Heap Space Error

Posted by Jo...@wellsfargo.com.INVALID.
Pratik,

You’re getting the error when executing a DB query.  How many rows does it return?  Could it be returning too many rows?
________________________________
From: Pratik.Kulkarni@shell.com.INVALID <Pr...@shell.com.INVALID>
Sent: Thursday, April 13, 2023 9:55:06 PM
To: users@tomcat.apache.org <us...@tomcat.apache.org>
Subject: RE: Java Heap Space Error

Hi All,

Thanks for your quick suggestions.

As Olaf suggested, I tried to set the same values to Xms and Xmx; the application immediately crashes after Tomcat restart and I am not able to access it. I tried it with different values, but the result is the same. Regarding the memory leak, let me check on how to monitor an Oracle Apex application running on Tomcat, since this is something I have never done before.

Kevin and John- The heap dump is not generated, but I am looking into generating it. I have looked up a tool called visualvm and I am taking it on the server. Once I have those, I'll attach them here to see if those can be of any help.

Chris - I see. So we already have installed a service and I tried to set the environment variable after we got the error. Is there a way for Tomcat to read the variables we set after installation? Also, what I meant by "when I access the application" is that it worked for a few requests; but as soon as I started to launch the pages which have SQL queries being executed to fetch user data, the application was crashing with this error. When I set both values for Xms and Xmx as Olaf suggested, the application crashed right on Tomcat startup, so I couldn't access the URL at all. Also, below is the output of tomcat_stderr,

-----
2023-04-14 02:47:53 Apache Commons Daemon procrun stderr initialized.
14-Apr-2023 02:47:55.483 WARNING [main] org.apache.tomcat.util.digester.SetPropertiesRule.begin Match [Server/Service/Connector] failed to set property [maxSpareThreads] to [75]
14-Apr-2023 02:47:55.563 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name:   Apache Tomcat/9.0.73
14-Apr-2023 02:47:55.563 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Feb 27 2023 15:33:40 UTC
14-Apr-2023 02:47:55.563 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 9.0.73.0
14-Apr-2023 02:47:55.564 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Windows Server 2016
14-Apr-2023 02:47:55.564 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            10.0
14-Apr-2023 02:47:55.564 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
14-Apr-2023 02:47:55.564 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             C:\Program Files\Java\jre1.8.0_361
14-Apr-2023 02:47:55.564 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_361-b09
14-Apr-2023 02:47:55.565 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
14-Apr-2023 02:47:55.565 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         C:\Program Files\Apache Software Foundation\Tomcat9.0.73
14-Apr-2023 02:47:55.565 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         C:\Program Files\Apache Software Foundation\Tomcat9.0.73
14-Apr-2023 02:47:55.566 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat9.0.73
14-Apr-2023 02:47:55.566 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat9.0.73
14-Apr-2023 02:47:55.566 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat9.0.73\temp
14-Apr-2023 02:47:55.567 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
14-Apr-2023 02:47:55.567 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Program Files\Apache Software Foundation\Tomcat9.0.73\conf\logging.properties
14-Apr-2023 02:47:55.567 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: exit
14-Apr-2023 02:47:55.567 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: abort
14-Apr-2023 02:47:55.567 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms128m
14-Apr-2023 02:47:55.567 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx256m
14-Apr-2023 02:47:55.577 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The Apache Tomcat Native library which allows using OpenSSL was not found on the java.library.path: [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\Java\jre1.8.0_361\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\app\client\product\12.2.0\client_1\bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.8.0_121\bin;C:\Program Files\PuTTY\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Java\jre1.8.0_351\bin;C:\Windows\ServiceProfiles\LocalService\AppData\Local\Microsoft\WindowsApps;.]
14-Apr-2023 02:47:56.694 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
14-Apr-2023 02:47:56.725 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["https-jsse-nio-443"]
14-Apr-2023 02:47:57.061 INFO [main] org.apache.tomcat.util.net.AbstractEndpoint.logCertificate Connector [https-jsse-nio-443], TLS virtual host [_default_], certificate type [UNDEFINED] configured from [C:\Program Files\Java\jdk1.8.0_121\bin\sww-twif-dev-2023.shell.com.jks] using alias [sww-twif-dev.shell.com] and with trust store [null]
14-Apr-2023 02:47:57.063 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [1779] milliseconds
14-Apr-2023 02:47:57.115 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
14-Apr-2023 02:47:57.115 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.73]
14-Apr-2023 02:47:57.144 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\ords.war]
14-Apr-2023 02:48:02.701 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
14-Apr-2023 02:48:03.790 INFO [main] . Validating pool: |apex||
14-Apr-2023 02:48:04.441 INFO [main] . Pool: |apex|| is correctly configured
14-Apr-2023 02:48:04.442 INFO [main] . Validating pool: |apex|al|
14-Apr-2023 02:48:04.524 INFO [main] . Pool: |apex|al| is correctly configured
14-Apr-2023 02:48:04.524 INFO [main] . Validating pool: |apex|pu|
14-Apr-2023 02:48:04.599 INFO [main] . Pool: |apex|pu| is correctly configured
14-Apr-2023 02:48:04.600 INFO [main] . Validating pool: |apex|rt|
14-Apr-2023 02:48:04.674 INFO [main] . Pool: |apex|rt| is correctly configured
14-Apr-2023 02:48:05.118 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\ords.war] has finished in [7,974] ms
14-Apr-2023 02:48:05.119 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\docs]
14-Apr-2023 02:48:05.177 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\docs] has finished in [58] ms
14-Apr-2023 02:48:05.178 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\examples]
14-Apr-2023 02:48:06.623 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\examples] has finished in [1,444] ms
14-Apr-2023 02:48:06.623 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\host-manager]
14-Apr-2023 02:48:06.687 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\host-manager] has finished in [64] ms
14-Apr-2023 02:48:06.688 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\i]
14-Apr-2023 02:48:06.728 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\i] has finished in [40] ms
14-Apr-2023 02:48:06.729 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\manager]
14-Apr-2023 02:48:06.787 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\manager] has finished in [59] ms
14-Apr-2023 02:48:06.788 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\params]
14-Apr-2023 02:48:06.810 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\params] has finished in [22] ms
14-Apr-2023 02:48:06.810 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\ROOT]
14-Apr-2023 02:48:06.848 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\ROOT] has finished in [37] ms
14-Apr-2023 02:48:06.853 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
14-Apr-2023 02:48:06.872 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["https-jsse-nio-443"]
14-Apr-2023 02:48:06.879 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [9815] milliseconds
14-Apr-2023 02:48:10.922 INFO [https-jsse-nio-443-exec-15] . Configuration properties for: |apex||
cache.caching=false
cache.directory=/tmp/apex/cache
cache.duration=days
cache.expiration=7
cache.maxEntries=500
cache.monitorInterval=60
cache.procedureNameList=
cache.type=lru
db.hostname=9716960-adotwf5.sga-res.com
db.port=1648
db.servicename=TWIFPDB2
debug.debugger=false
debug.printDebugToScreen=false
error.keepErrorMessages=true
error.maxEntries=50
jdbc.DriverType=thin
jdbc.InactivityTimeout=1800
jdbc.InitialLimit=3
jdbc.MaxConnectionReuseCount=1000
jdbc.MaxLimit=10
jdbc.MaxStatementsLimit=10
jdbc.MinLimit=1
jdbc.statementTimeout=900
log.logging=false
log.maxEntries=50
misc.compress=
misc.defaultPage=apex
security.crypto.enc.password=******
security.crypto.mac.password=******
security.disableDefaultExclusionList=false
security.maxEntries=2000
security.requestValidationFunction=wwv_flow_epg_include_modules.authorize
security.validationFunctionType=plsql
db.password=******
db.username=APEX_PUBLIC_USER

14-Apr-2023 02:48:10.923 WARNING [https-jsse-nio-443-exec-15] . *** jdbc.MaxLimit in configuration |apex|| is using a value of 10, this setting may not be sized adequately for a production environment ***
14-Apr-2023 02:48:10.923 WARNING [https-jsse-nio-443-exec-15] . *** jdbc.InitialLimit in configuration |apex|| is using a value of 3, this setting may not be sized adequately for a production environment ***
14-Apr-2023 02:48:11.192 INFO [https-jsse-nio-443-exec-15] oracle.ucp.common.UniversalConnectionPoolBase.initInactiveConnectionTimeoutTimer inactive connection timeout timer scheduled
14-Apr-2023 02:48:30.591 SEVERE [https-jsse-nio-443-exec-2] . Java heap space
        java.lang.OutOfMemoryError: Java heap space
                at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:165)
                at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:48)
                at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:938)
                at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1150)
                at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:4802)
                at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:4905)
                at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:5631)
                at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1385)
                at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                at java.lang.reflect.Method.invoke(Unknown Source)
                at oracle.ucp.jdbc.proxy.StatementProxyFactory.invoke(StatementProxyFactory.java:353)
                at oracle.ucp.jdbc.proxy.PreparedStatementProxyFactory.invoke(PreparedStatementProxyFactory.java:178)
                at oracle.ucp.jdbc.proxy.CallableStatementProxyFactory.invoke(CallableStatementProxyFactory.java:136)
                at com.sun.proxy.$Proxy40.execute(Unknown Source)
                at oracle.dbtools.apex.OWA.execute(OWA.java:169)
                at oracle.dbtools.apex.ModApex.handleRequest(ModApex.java:267)
                at oracle.dbtools.apex.ModApex.doPost(ModApex.java:174)
                at oracle.dbtools.apex.ModApex.service(ModApex.java:102)
                at oracle.dbtools.http.entrypoint.Dispatcher.dispatch(Dispatcher.java:125)
                at oracle.dbtools.http.entrypoint.EntryPoint$FilteredServlet.service(EntryPoint.java:240)
                at oracle.dbtools.http.filters.FilterChainImpl.doFilter(FilterChainImpl.java:73)
                at oracle.dbtools.http.forwarding.QueryFilteringRewrite.doFilter(QueryFilteringRewrite.java:90)
                at oracle.dbtools.http.filters.HttpFilter.doFilter(HttpFilter.java:47)
                at oracle.dbtools.http.filters.FilterChainImpl.doFilter(FilterChainImpl.java:64)
                at oracle.dbtools.http.forwarding.ForwardingFilter.doFilter(ForwardingFilter.java:68)
                at oracle.dbtools.http.filters.HttpFilter.doFilter(HttpFilter.java:47)
                at oracle.dbtools.http.filters.FilterChainImpl.doFilter(FilterChainImpl.java:64)
                at oracle.dbtools.http.cors.CORSPreflightFilter.doFilter(CORSPreflightFilter.java:66)
                at oracle.dbtools.http.filters.HttpFilter.doFilter(HttpFilter.java:47)
                at oracle.dbtools.http.filters.FilterChainImpl.doFilter(FilterChainImpl.java:64)
                at oracle.dbtools.http.cookies.auth.CookieSessionCSRFFilter.doFilter(CookieSessionCSRFFilter.java:77)

-----

Thanks and regards,
Pratik Kulkarni

-----Original Message-----
From: Christopher Schultz <ch...@christopherschultz.net>
Sent: Friday, April 14, 2023 00:28
To: users@tomcat.apache.org
Subject: Re: Java Heap Space Error

Think Secure. This email is from an external source.

Pratik,

On 4/13/23 05:35, Pratik.Kulkarni@shell.com.INVALID wrote:
> 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.

Definitely see the other replies as well, but I have a few comments.

Setting CATALINA_OPTS on the command-line may not affect your running process, depending upon how to launch Tomcat. If you are using the Windows Service, for example, that environment variable does nothing after the service has been installed.

You say the error happens "when you access the application". Can you be more specific? For example, doe sit fail on "first access" after a restart, or does it fail after some number of requests?

Please look in any of these files for a full stack trace of the OOME:

%CATALINA_HOME%/logs/catalina.out
%CATALINA_HOME%/logs/*stdout*
%CATALINA_HOME%/logs/*stderr*

%CATALINA_BASE%/logs/catalina.out
%CATALINA_BASE%/logs/*stdout*
%CATALINA_BASE%/logs/*stderr*

and post the complete stack trace.

-chris

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


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


RE: Java Heap Space Error

Posted by Eduardo Quintanilla <eq...@bnext.mx>.
In Windows, the installer define Initial memory pool: 128 MB and Maximum memory pool: 256 MB, the configuration is available in the Tomcat8w gui app.
I see the same on Tomcat 8 and 9.


-----Original Message-----
From: Christopher Schultz <ch...@christopherschultz.net>
Sent: jueves, 20 de abril de 2023 09:21 a. m.
To: users@tomcat.apache.org
Subject: Re: Java Heap Space Error

Pratik,

On 4/20/23 03:35, Pratik.Kulkarni@shell.com.INVALID wrote:
> I guess you're right, Tomcat 9 allocates less default memory compared
> to Tomcat 8; I checked our logs and below are the memory parameters
> which seem to be passed in,
>
> Tomcat 9 -
>
> 14-Apr-2023 02:47:55.567 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log Command line
> argument: -Xms128m
> 14-Apr-2023 02:47:55.567 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log Command line
> argument: -Xmx256m
>
> Tomcat 8 -
>
> 13-Apr-2023 06:10:01.520 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log Command line
> argument: -Xms512m
> 13-Apr-2023 06:10:01.520 INFO [main]
> org.apache.catalina.startup.VersionLoggerListener.log Command line
> argument: -Xmx1024m
>
> Like you suggested, I updated the configuration using Tomcat9w.exe since we are running Tomcat as a service and it is now working without any errors! I updated the sizes from 128MB and 256MB to 512MB and 1024MB respectively for max and min pool sizes.
>
> Thank you very much everyone for your help, I truly appreciate it. I believe we can mark this thread as solved.

I don't believe Tomcat comes with any default at all. Whatever you are seeing there probably came from a local setup that you (or someone else
local) did.

Glad you got things working again.

-chris

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



The information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact the sender and delete the material from any computer.
La información transmitida está destinada únicamente a la persona o entidad a quien que va dirigida y puede contener información confidencial y/o material privilegiado. Cualquier revisión, retransmisión, difusión u otros usos, o cualquier acción tomada por personas o entidades distintas al destinatario basándose en esta información está prohibida. Si usted recibe este mensaje por error, por favor contacte al remitente y elimine el material de cualquier computadora.

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


Re: Java Heap Space Error

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Pratik,

On 4/20/23 03:35, Pratik.Kulkarni@shell.com.INVALID wrote:
> I guess you're right, Tomcat 9 allocates less default memory compared to Tomcat 8; I checked our logs and below are the memory parameters which seem to be passed in,
> 
> Tomcat 9 -
> 
> 14-Apr-2023 02:47:55.567 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms128m
> 14-Apr-2023 02:47:55.567 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx256m
> 
> Tomcat 8 -
> 
> 13-Apr-2023 06:10:01.520 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms512m
> 13-Apr-2023 06:10:01.520 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx1024m
> 
> Like you suggested, I updated the configuration using Tomcat9w.exe since we are running Tomcat as a service and it is now working without any errors! I updated the sizes from 128MB and 256MB to 512MB and 1024MB respectively for max and min pool sizes.
> 
> Thank you very much everyone for your help, I truly appreciate it. I believe we can mark this thread as solved.

I don't believe Tomcat comes with any default at all. Whatever you are 
seeing there probably came from a local setup that you (or someone else 
local) did.

Glad you got things working again.

-chris

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


RE: Java Heap Space Error

Posted by Pr...@shell.com.INVALID.
Thanks Chris,

I guess you're right, Tomcat 9 allocates less default memory compared to Tomcat 8; I checked our logs and below are the memory parameters which seem to be passed in,

Tomcat 9 - 

14-Apr-2023 02:47:55.567 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms128m
14-Apr-2023 02:47:55.567 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx256m

Tomcat 8 - 

13-Apr-2023 06:10:01.520 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms512m
13-Apr-2023 06:10:01.520 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx1024m

Like you suggested, I updated the configuration using Tomcat9w.exe since we are running Tomcat as a service and it is now working without any errors! I updated the sizes from 128MB and 256MB to 512MB and 1024MB respectively for max and min pool sizes.

Thank you very much everyone for your help, I truly appreciate it. I believe we can mark this thread as solved.

Kind regards,
Pratik Kulkarni

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


Re: Java Heap Space Error

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Pratik,

On 4/13/23 22:55, Pratik.Kulkarni@shell.com.INVALID wrote:
> Chris - I see. So we already have installed a service and I tried to
> set the environment variable after we got the error. Is there a way
> for Tomcat to read the variables we set after installation?
If you are running the Windows Service to launch Tomcat, you need to 
edit the service using tomcat9w.exe. There is a panel for Java options 
and you can set the heap sizes there.

> Also, what I meant by "when I access the application" is that it
> worked for a few requests; but as soon as I started to launch the pages
> which have SQL queries being executed to fetch user data, the
> application was crashing with this error.

I wonder if Tomcat 9 requires just a little bit more memory in general 
than Tomcat 8 (and I'm not suggesting that it DOES, only that it MIGHT) 
and you had been riding the line between "runnable" and "runs out of 
memory all the time".

Are you able to run under Tomcat 8 and observe the total-heap-space 
versus used-heap-space over time to see how that compares to Tomcat 9? I 
wonder if Tomcat 8 was configured to provide enough heap space but your 
Tomcat 9 setup does not have that same configuration.

> When I set both values for Xms and Xmx as Olaf suggested, the application crashed right on Tomcat startup, so I couldn't access the URL at all. Also, below is the output of tomcat_stderr,

How did you set those values? What did you set them both to? When you 
say "crashed right on Tomcat startup", what was the error message you 
got? The stack trace you posted was from a request processing error, and 
not during startup.

-chris

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


Re: Java Heap Space Error

Posted by Olaf Kock <to...@olafkock.de>.
On 14.04.23 04:55, Pratik.Kulkarni@shell.com.INVALID wrote:
> Hi All,
>
> Thanks for your quick suggestions.
>
> As Olaf suggested, I tried to set the same values to Xms and Xmx; the application immediately crashes after Tomcat restart and I am not able to access it. I tried it with different values, but the result is the same. Regarding the memory leak, let me check on how to monitor an Oracle Apex application running on Tomcat, since this is something I have never done before.

Here are a few ideas for this paragraph:

As your application can't run with -Xms set to the limit, you have 
proven that your computer does not have enough memory to allocate for 
your requirements (maybe due to other applications taking it, maybe it's 
just due to low RAM to begin with. I'm not sure why this would surface 
after upgrading Tomcat, but maybe your settings are different in other 
aspects as well, or other applications now take more memory.

(I'd recommend Xms==Xmx for all Java Server applications, to get the 
OOME quicker, rather than Sunday night at 3am, at random)

If you just connect jconsole, you should be able to see a characteristic 
sawtooth curve of memory, going up, hinting at - not necessarily proving 
- memory leaks (it might also just indicate legitimate memory usage - 
it's a quick check: If the sawtooth is horizontal, you have a strong 
indicator that there's no memory leak)

Typically, I don't really concentrate on the actual stacktrace of the 
OOME, as this is just what happened to require the last bit of memory, 
after everything else has been consumed. This *might* be the guilty 
code, but it might also just be a false positive. To me, OOME 
stacktraces have more often misled me than they pointed to the problem. 
A heapdump, with an indicator of what actually consumes your memory (and 
then judging if it's legit or not) helps a lot more IMHO.

Olaf


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


RE: Java Heap Space Error

Posted by Pr...@shell.com.INVALID.
Hi All,

Thanks for your quick suggestions.

As Olaf suggested, I tried to set the same values to Xms and Xmx; the application immediately crashes after Tomcat restart and I am not able to access it. I tried it with different values, but the result is the same. Regarding the memory leak, let me check on how to monitor an Oracle Apex application running on Tomcat, since this is something I have never done before.

Kevin and John- The heap dump is not generated, but I am looking into generating it. I have looked up a tool called visualvm and I am taking it on the server. Once I have those, I'll attach them here to see if those can be of any help.

Chris - I see. So we already have installed a service and I tried to set the environment variable after we got the error. Is there a way for Tomcat to read the variables we set after installation? Also, what I meant by "when I access the application" is that it worked for a few requests; but as soon as I started to launch the pages which have SQL queries being executed to fetch user data, the application was crashing with this error. When I set both values for Xms and Xmx as Olaf suggested, the application crashed right on Tomcat startup, so I couldn't access the URL at all. Also, below is the output of tomcat_stderr,

-----
2023-04-14 02:47:53 Apache Commons Daemon procrun stderr initialized.
14-Apr-2023 02:47:55.483 WARNING [main] org.apache.tomcat.util.digester.SetPropertiesRule.begin Match [Server/Service/Connector] failed to set property [maxSpareThreads] to [75]
14-Apr-2023 02:47:55.563 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name:   Apache Tomcat/9.0.73
14-Apr-2023 02:47:55.563 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Feb 27 2023 15:33:40 UTC
14-Apr-2023 02:47:55.563 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 9.0.73.0
14-Apr-2023 02:47:55.564 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Windows Server 2016
14-Apr-2023 02:47:55.564 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            10.0
14-Apr-2023 02:47:55.564 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
14-Apr-2023 02:47:55.564 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             C:\Program Files\Java\jre1.8.0_361
14-Apr-2023 02:47:55.564 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_361-b09
14-Apr-2023 02:47:55.565 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
14-Apr-2023 02:47:55.565 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         C:\Program Files\Apache Software Foundation\Tomcat9.0.73
14-Apr-2023 02:47:55.565 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         C:\Program Files\Apache Software Foundation\Tomcat9.0.73
14-Apr-2023 02:47:55.566 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat9.0.73
14-Apr-2023 02:47:55.566 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat9.0.73
14-Apr-2023 02:47:55.566 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat9.0.73\temp
14-Apr-2023 02:47:55.567 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
14-Apr-2023 02:47:55.567 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Program Files\Apache Software Foundation\Tomcat9.0.73\conf\logging.properties
14-Apr-2023 02:47:55.567 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: exit
14-Apr-2023 02:47:55.567 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: abort
14-Apr-2023 02:47:55.567 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms128m
14-Apr-2023 02:47:55.567 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx256m
14-Apr-2023 02:47:55.577 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The Apache Tomcat Native library which allows using OpenSSL was not found on the java.library.path: [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\Java\jre1.8.0_361\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\app\client\product\12.2.0\client_1\bin;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Java\jdk1.8.0_121\bin;C:\Program Files\PuTTY\;C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Java\jre1.8.0_351\bin;C:\Windows\ServiceProfiles\LocalService\AppData\Local\Microsoft\WindowsApps;.]
14-Apr-2023 02:47:56.694 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
14-Apr-2023 02:47:56.725 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["https-jsse-nio-443"]
14-Apr-2023 02:47:57.061 INFO [main] org.apache.tomcat.util.net.AbstractEndpoint.logCertificate Connector [https-jsse-nio-443], TLS virtual host [_default_], certificate type [UNDEFINED] configured from [C:\Program Files\Java\jdk1.8.0_121\bin\sww-twif-dev-2023.shell.com.jks] using alias [sww-twif-dev.shell.com] and with trust store [null]
14-Apr-2023 02:47:57.063 INFO [main] org.apache.catalina.startup.Catalina.load Server initialization in [1779] milliseconds
14-Apr-2023 02:47:57.115 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
14-Apr-2023 02:47:57.115 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/9.0.73]
14-Apr-2023 02:47:57.144 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deploying web application archive [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\ords.war]
14-Apr-2023 02:48:02.701 INFO [main] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
14-Apr-2023 02:48:03.790 INFO [main] . Validating pool: |apex||
14-Apr-2023 02:48:04.441 INFO [main] . Pool: |apex|| is correctly configured
14-Apr-2023 02:48:04.442 INFO [main] . Validating pool: |apex|al|
14-Apr-2023 02:48:04.524 INFO [main] . Pool: |apex|al| is correctly configured
14-Apr-2023 02:48:04.524 INFO [main] . Validating pool: |apex|pu|
14-Apr-2023 02:48:04.599 INFO [main] . Pool: |apex|pu| is correctly configured
14-Apr-2023 02:48:04.600 INFO [main] . Validating pool: |apex|rt|
14-Apr-2023 02:48:04.674 INFO [main] . Pool: |apex|rt| is correctly configured
14-Apr-2023 02:48:05.118 INFO [main] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\ords.war] has finished in [7,974] ms
14-Apr-2023 02:48:05.119 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\docs]
14-Apr-2023 02:48:05.177 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\docs] has finished in [58] ms
14-Apr-2023 02:48:05.178 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\examples]
14-Apr-2023 02:48:06.623 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\examples] has finished in [1,444] ms
14-Apr-2023 02:48:06.623 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\host-manager]
14-Apr-2023 02:48:06.687 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\host-manager] has finished in [64] ms
14-Apr-2023 02:48:06.688 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\i]
14-Apr-2023 02:48:06.728 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\i] has finished in [40] ms
14-Apr-2023 02:48:06.729 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\manager]
14-Apr-2023 02:48:06.787 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\manager] has finished in [59] ms
14-Apr-2023 02:48:06.788 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\params]
14-Apr-2023 02:48:06.810 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\params] has finished in [22] ms
14-Apr-2023 02:48:06.810 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\ROOT]
14-Apr-2023 02:48:06.848 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [C:\Program Files\Apache Software Foundation\Tomcat9.0.73\webapps\ROOT] has finished in [37] ms
14-Apr-2023 02:48:06.853 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
14-Apr-2023 02:48:06.872 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["https-jsse-nio-443"]
14-Apr-2023 02:48:06.879 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in [9815] milliseconds
14-Apr-2023 02:48:10.922 INFO [https-jsse-nio-443-exec-15] . Configuration properties for: |apex||
cache.caching=false
cache.directory=/tmp/apex/cache
cache.duration=days
cache.expiration=7
cache.maxEntries=500
cache.monitorInterval=60
cache.procedureNameList=
cache.type=lru
db.hostname=9716960-adotwf5.sga-res.com
db.port=1648
db.servicename=TWIFPDB2
debug.debugger=false
debug.printDebugToScreen=false
error.keepErrorMessages=true
error.maxEntries=50
jdbc.DriverType=thin
jdbc.InactivityTimeout=1800
jdbc.InitialLimit=3
jdbc.MaxConnectionReuseCount=1000
jdbc.MaxLimit=10
jdbc.MaxStatementsLimit=10
jdbc.MinLimit=1
jdbc.statementTimeout=900
log.logging=false
log.maxEntries=50
misc.compress=
misc.defaultPage=apex
security.crypto.enc.password=******
security.crypto.mac.password=******
security.disableDefaultExclusionList=false
security.maxEntries=2000
security.requestValidationFunction=wwv_flow_epg_include_modules.authorize
security.validationFunctionType=plsql
db.password=******
db.username=APEX_PUBLIC_USER

14-Apr-2023 02:48:10.923 WARNING [https-jsse-nio-443-exec-15] . *** jdbc.MaxLimit in configuration |apex|| is using a value of 10, this setting may not be sized adequately for a production environment ***
14-Apr-2023 02:48:10.923 WARNING [https-jsse-nio-443-exec-15] . *** jdbc.InitialLimit in configuration |apex|| is using a value of 3, this setting may not be sized adequately for a production environment ***
14-Apr-2023 02:48:11.192 INFO [https-jsse-nio-443-exec-15] oracle.ucp.common.UniversalConnectionPoolBase.initInactiveConnectionTimeoutTimer inactive connection timeout timer scheduled
14-Apr-2023 02:48:30.591 SEVERE [https-jsse-nio-443-exec-2] . Java heap space
	java.lang.OutOfMemoryError: Java heap space
		at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:165)
		at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:48)
		at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:938)
		at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1150)
		at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:4802)
		at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:4905)
		at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:5631)
		at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1385)
		at sun.reflect.GeneratedMethodAccessor48.invoke(Unknown Source)
		at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
		at java.lang.reflect.Method.invoke(Unknown Source)
		at oracle.ucp.jdbc.proxy.StatementProxyFactory.invoke(StatementProxyFactory.java:353)
		at oracle.ucp.jdbc.proxy.PreparedStatementProxyFactory.invoke(PreparedStatementProxyFactory.java:178)
		at oracle.ucp.jdbc.proxy.CallableStatementProxyFactory.invoke(CallableStatementProxyFactory.java:136)
		at com.sun.proxy.$Proxy40.execute(Unknown Source)
		at oracle.dbtools.apex.OWA.execute(OWA.java:169)
		at oracle.dbtools.apex.ModApex.handleRequest(ModApex.java:267)
		at oracle.dbtools.apex.ModApex.doPost(ModApex.java:174)
		at oracle.dbtools.apex.ModApex.service(ModApex.java:102)
		at oracle.dbtools.http.entrypoint.Dispatcher.dispatch(Dispatcher.java:125)
		at oracle.dbtools.http.entrypoint.EntryPoint$FilteredServlet.service(EntryPoint.java:240)
		at oracle.dbtools.http.filters.FilterChainImpl.doFilter(FilterChainImpl.java:73)
		at oracle.dbtools.http.forwarding.QueryFilteringRewrite.doFilter(QueryFilteringRewrite.java:90)
		at oracle.dbtools.http.filters.HttpFilter.doFilter(HttpFilter.java:47)
		at oracle.dbtools.http.filters.FilterChainImpl.doFilter(FilterChainImpl.java:64)
		at oracle.dbtools.http.forwarding.ForwardingFilter.doFilter(ForwardingFilter.java:68)
		at oracle.dbtools.http.filters.HttpFilter.doFilter(HttpFilter.java:47)
		at oracle.dbtools.http.filters.FilterChainImpl.doFilter(FilterChainImpl.java:64)
		at oracle.dbtools.http.cors.CORSPreflightFilter.doFilter(CORSPreflightFilter.java:66)
		at oracle.dbtools.http.filters.HttpFilter.doFilter(HttpFilter.java:47)
		at oracle.dbtools.http.filters.FilterChainImpl.doFilter(FilterChainImpl.java:64)
		at oracle.dbtools.http.cookies.auth.CookieSessionCSRFFilter.doFilter(CookieSessionCSRFFilter.java:77)

-----

Thanks and regards,
Pratik Kulkarni

-----Original Message-----
From: Christopher Schultz <ch...@christopherschultz.net> 
Sent: Friday, April 14, 2023 00:28
To: users@tomcat.apache.org
Subject: Re: Java Heap Space Error

Think Secure. This email is from an external source.

Pratik,

On 4/13/23 05:35, Pratik.Kulkarni@shell.com.INVALID wrote:
> 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.

Definitely see the other replies as well, but I have a few comments.

Setting CATALINA_OPTS on the command-line may not affect your running process, depending upon how to launch Tomcat. If you are using the Windows Service, for example, that environment variable does nothing after the service has been installed.

You say the error happens "when you access the application". Can you be more specific? For example, doe sit fail on "first access" after a restart, or does it fail after some number of requests?

Please look in any of these files for a full stack trace of the OOME:

%CATALINA_HOME%/logs/catalina.out
%CATALINA_HOME%/logs/*stdout*
%CATALINA_HOME%/logs/*stderr*

%CATALINA_BASE%/logs/catalina.out
%CATALINA_BASE%/logs/*stdout*
%CATALINA_BASE%/logs/*stderr*

and post the complete stack trace.

-chris

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


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


Re: Java Heap Space Error

Posted by Christopher Schultz <ch...@christopherschultz.net>.
Pratik,

On 4/13/23 05:35, Pratik.Kulkarni@shell.com.INVALID wrote:
> 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.

Definitely see the other replies as well, but I have a few comments.

Setting CATALINA_OPTS on the command-line may not affect your running 
process, depending upon how to launch Tomcat. If you are using the 
Windows Service, for example, that environment variable does nothing 
after the service has been installed.

You say the error happens "when you access the application". Can you be 
more specific? For example, doe sit fail on "first access" after a 
restart, or does it fail after some number of requests?

Please look in any of these files for a full stack trace of the OOME:

%CATALINA_HOME%/logs/catalina.out
%CATALINA_HOME%/logs/*stdout*
%CATALINA_HOME%/logs/*stderr*

%CATALINA_BASE%/logs/catalina.out
%CATALINA_BASE%/logs/*stdout*
%CATALINA_BASE%/logs/*stderr*

and post the complete stack trace.

-chris

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