2

I am trying to to detect what causes massive spikes in our Java struts bases web application deployed in Jboss. I have used Yourkit and visualVM to take dumps and have analysed dumps but these spikes are momentary and by the time the dump is taken nothing remains.

Question is - is there a way to detect what is causing a spike in the runtime?

Nandkumar Tekale
  • 16,024
  • 8
  • 58
  • 85
Soumya
  • 1,054
  • 2
  • 16
  • 31

2 Answers2

3

Here are a couple of ideas:

  • Examine your request logs to see if there is any correlation with the spikes and either request volumes or specific request types.

  • Run the JVM with GC logging enabled and look for correlations.

  • Enable your debug-level logging in your application and look for correlations. (Be cautious with this one because turning on more application logging could change performance characteristics.)

  • (On Linux / Unix) run vmstat and iostat and look for correlations with extra disc activity or swapping/paging.


If you have a spike in the object creation rate or in the number / size of non-garbage objects, this is most likely caused by your application rather than the JVM or operating system. There is a good chance that it is due to a transient change in the nature of the application's workload; e.g. it is getting a spike in the requests, or it there is some unusual request that involves creating a lot of objects. Focus on the request and application logs.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
  • It's a Windows machine. Yes I guess I can turn on more logging in the application to see what is happening at that time. However the application has several pages and modules - all being used at the same time. So it's a bit tedious doing it that way. I was looking for tool that I can inject into the application which can log when some thread tries to create a lot of objects... or something in that line. Easier said than done probably :( – Soumya Jan 24 '13 at 15:02
2

As most likely garbage collection can cause such an issue, I'd recommend enabling the garbage collection logging in the JVM using these command line options:

  • -Xloggc:<path and filename to log to>
  • -XX:+PrintGCDetails
ppeterka
  • 20,583
  • 6
  • 63
  • 78
  • Thanks. Sorry did you mean turning these ON will have an adverse effect on performance in the Live app? – Soumya Jan 24 '13 at 15:00
  • @Soumya no, sorry if it was not clear. Though GC logging might need some disk IO, I don't think turning them on would make any significant performance issues. I rephrased the answer to be clearer. – ppeterka Jan 25 '13 at 08:00