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.kulka...@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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


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

Reply via email to