cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

Tomcat high memory usage with less CPU Consumption

SaranKarthick
16-Pearl

Tomcat high memory usage with less CPU Consumption

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

5 REPLIES 5

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?

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

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.

 

Hi @CarlesColl ,

 

Thanks for your inputs on this issue. I understand that there might be lot of factors which contributes to this issue. But its very challenging for me to even start with the debugging. I'm unable to find any articles/online analysis tool  which gives some direction on how to start debugging and eventually to narrow down to root cause.

 

It'll be really helpful if you could suggest some articles/tools regarding the same.

 

Regards,

Saran

Hi @CarlesColl ,

 

I had raised a PTC ticket for this issue and was able to filter out the services which were causing this issue. Now I'm trying to refine them and i had given a brief about the services in this community topic. Please have a look.

 

Regards,

Saran

Top Tags