• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Tomcat Garbage Collection for PS Old Gen

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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


JMeter-settings.GIF
[Thumbnail for JMeter-settings.GIF]
Jmeter settings
PS-OLD-Gen.GIF
[Thumbnail for PS-OLD-Gen.GIF]
PS Perm Gen
VM-Summary.GIF
[Thumbnail for VM-Summary.GIF]
VM Summary
 
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 443
3
Eclipse IDE C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic