Using hprof in a running application in Sun Java 5

We have an enterprise Java application (ear - multiple ejb and webapp) deployed on weblogic 10 and using Sun java 5. Response times, CPU and memory usage are fine under multiple boot users, but if we increase the number of concurrent ones to> 100 we see huge spikes in CPU over time (eg: - load test with 100 users, CPU peaks after more than 30 minutes test). We wanted to use hprof to profile the application and collect statistics, but only wanted to do so when the CPU is high. After 3 minutes of test, is there a way to do this?

I cannot use jmap because we are using Sun java 5.

0


a source to share


3 answers


Huge bursts in the processor can be an indicator of GC activity. If so, it will not show up in the profiler. You can run with -verbosegc to see when the GC is running. (Or use jconsole)



+1


a source


This is JVM specific. Hence, you need to specify which JVM you are using (Sun / BEA / IBM, etc.).



Having guessed this, consider setting the session timeout on your web container to 60 seconds and retest.

0


a source


If nothing else, you can try several options:

  • when the cpu goes high, just CTRL + BREAK a few times and see if you can "eyeball" where threads tend to be (in UNIX for this you call kill on a process with a signal number that temporarily eludes my mind);
  • with hprof, just profile all the time anyway , and see if it offers keys anyway - if it's the bit where the CPU is high that you're interested in, then it might take most of the time, even if you originally worked with low processor;
  • from within your program itself, consider using some of the thread profiling calls available through the ThreadMXBean .

I appreciate that these are not all cups of tea, but it will eventually allow you to do what you want to do.

0


a source







All Articles