开发者

Analysing Memory Issues

开发者 https://www.devze.com 2023-04-01 19:18 出处:网络
We have an issue where on the JVMs memory usage increases gradually and then this impacts CPU performance. It increases CPU time.

We have an issue where on the JVMs memory usage increases gradually and then this impacts CPU performance. It increases CPU time. We are trying to take heap dump to analyse the issue. But wanted to understand what is the typical procedure - does looking at gc log, looking at heap dump provide the required information. What are the other things which one needs to wat开发者_C百科ch out for?


Please look at the heap dump and GC dump and try to anaylse that at the time when GC reaches its peak, any major task is going on. For example - Cron jobs scehduled at that time on your server etc.

You will get an idea as to what exactly is affecting your application.


The approach I take it is to use a memory profile to reduce both the amount memory retained after a GC and the amount of garbage discarded. Reducing object discarding, can improve performance and reduce noise in the profile results.


Here is how we analyzed the problem:

  1. We looked at the recent code changes to identify the areas changed
  2. Took a heapdump
  3. Looked at thread dump.(was not very useful for our current analysis). Heapdump told us the kind of the objects which are very high in memory, these were cache objects.

But the recent code changes kind of helped us explain our current situation. Actually the interesting thing was that we had increased timeouts for some of threads we were forking. This internally caused lot of concurrency and the result was increased memory usage since some objects might now be held longer before being GC-able. Our usecases supported possibility of such contention.

Overall what I could understand was that heap dumps, thread dumps and recent changes - all looked together helped us understand the issue. Any one of them individually did not make sense.

0

精彩评论

暂无评论...
验证码 换一张
取 消