简体   繁体   中英

Does high cpu usage affect JAVA GC?

Recently I am developing an android app for video conferencing. I observed that when the cpu usage is less than 95%, there is half free memory left. However when the cpu usage goes up, the memory usage will soon reach 90% and even more. I don`t have much knowledge with JVM or GC and I was wondering is the GC performance somehow related two the cpu usage?

If it is, is there a advice that I can follow to balance cpu and memory usage?

Thank you in advance.

I suspect that the causal relationship is the other way around.

  • Your heap is getting too full.
  • That is causing the GC to run frequently.
  • That is causing the CPU usage to peak.

If this is the problem, you should be looking for what is causing your heap to get too full; eg look for memory leaks.

http://www.dynatrace.com/en/javabook/impact-of-garbage-collection-on-performance.html

That link should explain how gc works. In general high memory means you have too many objects open and garbage collection cannot close them. Not the other way around.

Based on the stats you have provided it looks like as your app does more processing it needs more memory not allowing information to be removed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM