File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Performance and the fly likes Tomcat Garbage Collection for PS Old Gen Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Performance
Bookmark "Tomcat Garbage Collection for PS Old Gen" Watch "Tomcat Garbage Collection for PS Old Gen" New topic
Author

Tomcat Garbage Collection for PS Old Gen

Ramans mann
Greenhorn

Joined: Aug 08, 2011
Posts: 7
Hi Every One,

I would need some serious help with my application.Recently my QA did some performance testing on the QA machine and figured the application is consuming whole heap within one hour of Jmeter performance testing.See the Jmeter settings attached .
Application Details
------------------------
Application using:JSF,Hibernate-JPA
Application server:Tomcat
Total RAM 3.6 GB
Applications running on system:None other then the application.
Operating system:Linux (Check VM summary image for more details.)
Number of processors :2

I installed Jconsole and changed some of the JVm settings to make my application to use parallel GC by adding UseParallelOldGC .But my application consumes the whole Old gen within an hour.Please tell me what should I use to improve my JVM settings so that my application does not consume "Old Gen". Please see attached image for my OLD Gen consumption.

System JVM Settings(Check VM summary image for more details):

JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms768m -Xmx2048m -XX:NewSize=662m -XX:MaxNewSize=662m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+UseParallelOldGC -XX:SurvivorRatio=6 "

I have attached my VM summary also so that you

Thanks in Advance,
Raman





[Thumbnail for JMeter settings.GIF]


[Thumbnail for PS OLD Gen.GIF]


[Thumbnail for VM Summary.GIF]

Jayesh A Lalwani
Bartender

Joined: Jan 17, 2008
Posts: 2274
    
  28

Whoa! you go from 0 to 1.5GB in a matter of minutes. Normally, I would tell people to get a heap dump and run the heap dump through MAT to find where the high memory usage is. However, looking at this, you probably should start by doing a code review. It should be very evident where you are using 1.5GB of memory if you know what you are doing in your application

What are you trying to do here? Are you loading large objects? Are you loading lots of small objects?
Ramans mann
Greenhorn

Joined: Aug 08, 2011
Posts: 7
We have a XML based SSO "XMl with user credentials and roles" and we are passing it between three different application.

Other then that we have JPA based fetching of you user information from database.the joins we use are really complex and consumes a lot of memory.

I have run my application using Jprofiler.All I can see is 600-700 mb of of char[]. There are millions of instances of Char arrays .If i drill them down I only see either some JSF files or some random strings.

What I conclude is that PS OLD memory is not getting released.I understand the application code has a lot of flaws but the only option left with me as of now is to improve GC and define a benchmark for my application so that it never reaches the stage if sent attached the screen shots for.

So i am trying the concurrent and parallel GC to clear the heap.What would be the best combination .?I am trying following options:

Option1 :
JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms768m -Xmx2048m -XX:NewSize=662m -XX:MaxNewSize=662m -XX:PermSize=256m -XX:MaxPermSize=512m -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+UseParNewGC -XX:SurvivorRatio=8 -XX:TargetSurvivorRatio=90 -XX:MaxTenuringThreshold=31 "


Option 2: JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true -Dfile.encoding=UTF-8 -server -Xms768m -Xmx2048m -XX:NewSize=662m -XX:MaxNewSize=662m -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+UseParallelOldGC -XX:SurvivorRatio=8 "

Please suggest which is a better approach.I want better more throughput and less response time.
Chris Hurst
Ranch Hand

Joined: Oct 26, 2003
Posts: 412
    
    2

Get a hprof via JMap use Eclipse MAT (free) or Visual VM (with jdk). Look at the MAT reports particularly leak.

Are the Char[] reachable or not (do they have GC roots) is they are GCwon't help if not they have lived too long so CMS might or a full GC.
Ignore the Char [] what's the first none primitive big thing "even" if it appears insignificant compare to Char [].

Consider Java's compressed strings option.

Get back when you have that leak report or report on Dominators by class.


"Eagles may soar but weasels don't get sucked into jet engines" SCJP 1.6, SCWCD 1.4, SCJD 1.5,SCBCD 5
 
Don't get me started about those stupid light bulbs.
 
subject: Tomcat Garbage Collection for PS Old Gen
 
Similar Threads
running tomcat in linux for production
Memory usage in JVM
PermGen error in Tomcat using Eclipse
JBoss performance decrease
Garbage collection issue in old gen space