Reputation: 1561
I am trying to analyze/profile a core JAVA application.
I am using JConsole with Eclipse MAT.
I observed following in Perm-Gen graphs(data recorded in 1 hour duration on a Windows XP machine):
Code-Cache:
Memory Pool Perm-Gen(Shared-rw):
Memory Pool Perm-Gen(Shared-r0):
Memory Pool:
My question is,
Ideal behaviour here refers to a state which represents:
Above question is also applicable for Heap space analysis.
Below are additional clarifications:
Its true that profiling should be done in same env as that of production. But it would really help if I can understand what is the real target here. As of now, I am trying to learn the same. Then in future, I will try to do it on production.
Also, I am trying to compare two code bases(one refactored and one old). I want to know the extent of benefits which are achieved by refactoring(as quantitative data). I think if I am recording results on same platform, comparison will hold true(regardless of Production or Development ).
UPDATE 1:
log-living
. Please have a look at the attachment. Please provide inputs.
Upvotes: 0
Views: 245
Reputation:
A couple of suggestions:
1) Ditch JConsole. VisualVM is included with the JDK and is superior in every respect (and includes a bridge mode so you can even use old plugins, if that's all that's keeping you on JConsole).
2) Switch GC logging on. You need at least these flags:
-Xloggc: (for more comprehensive GC logging) -XX:+PrintGCDetails (for more detailed output) -XX:+PrintTenuringDistribution (displays the tenuring thresholds assumed by the JVM)
Find a tool to analyse the logs - you need to pay attention to the working set of objects as well as PermGen, even if the the latter is your primary concern. GCViewer is free, or there are commercial tools (Full disclosure - I work for jClarity, which produces the Censum tool for this purpose).
3) You need to run for a lot longer than 1 hour. A lot of applications don't stabilise for quite a while.
4) Looking at your numbers again, this doesn't look that out of the ordinary / a problem. Why are you tuning this bit of the JVM? What aspect of the system has indicated that this is a serious problem and needs to be worked on? How did you determine this, and how is this problem manifesting?
Upvotes: 1