Skip to main content
1-Visitor
June 13, 2019
Question

Tomcat high memory usage with less CPU Consumption

  • June 13, 2019
  • 1 reply
  • 8062 views

Hi Developers,

 

I'm currently facing an issue where the tomcat CPU Consumption is well below 4% but the Memory Usage for the same is close to 90%(11,000 MB) as observed in the Task manager.

 

I had checked out this community link where the problem statement was similar to the one i'm facing. But one difference was i don't have any service which internally is updating the Session values rather the result is bound to a session variable and on run time its getting updated correspondingly.

 

I'm unable to narrow down to the specific service which is causing the problem.

 

I have even taken a stacktrace through the support tools extension but i couldn't interpret the logs.

 

What should be my next steps to identify the root cause?

 

Regards,

Saran

1 reply

1-Visitor
June 13, 2019
Actually Tomcat can eat as much memory as you want without using it at start, it's just a configuration parameter on Tomcat launch, did you check launch parameters for the jvc?
1-Visitor
June 14, 2019

Thanks for your reply @CarlesColl

The following are the JVM parameters I got from the catalina logs when i started the tomcat:

 

Server version: Apache Tomcat/8.5.23
Server built: Sep 28 2017 10:30:11 UTC
Server number: 8.5.23.0
OS Name: Windows Server 2012 R2
OS Version: 6.3
Architecture: amd64
Java Home: C:\Program Files\Java\jre1.8.0_92
JVM Version: 1.8.0_92-b14
JVM Vendor: Oracle Corporation
CATALINA_BASE: C:\Program Files\Apache Software Foundation\Tomcat 8.5
CATALINA_HOME: C:\Program Files\Apache Software Foundation\Tomcat 8.5
-Dcatalina.home=C:\Program Files\Apache Software Foundation\Tomcat 8.5
-Dcatalina.base=C:\Program Files\Apache Software Foundation\Tomcat 8.5
-Djava.io.tmpdir=C:\Program Files\Apache Software Foundation\Tomcat 8.5\temp
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
-Djava.util.logging.config.file=C:\Program Files\Apache Software Foundation\Tomcat 8.5\conf\logging.properties
-Dserver -Dd64
XX:+UseG1GC
-Dfile.encoding=UTF-8
-Djava.library.path=C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\Thingworx\WEB-INF\extensions
-Xloggc:logs/gc.out
-XX:+PrintGCTimeStamps
-XX:+PrintGCDateStamps
-XX:+PrintGCDetails
exit
-Xms3000m
-Xmx12000m

 

Also i came across an article and followed Method 1 as suggested in it. I can see now that the memory usage is down to 40%. Still I feel it is steadily increasing. 

 

If it reaches again to 90% should i update the launch params? If so what are the params to be updated & what value?

 

 

Regards,

Saran

1-Visitor
June 14, 2019

Hard to say, it depends a lot with the GarbageCollection and the real usage you are doing, hitting max memory doesn't means you are using it, it may mean that just GarbageCollection didn't take place.