Why does a bunch of JVMs continue to grow?

I am writing a simple program and use jconsole.exe to control heap size.

public class HeapTest { public static void main(String[] args) { while(true) { } } } 

Here is the result enter image description here

I do not understand why the heap size continues to grow. I am not new to () any object in my program.

What is the heap used in my program?

I am not adding any additional arguments to jconsole.exe; just double click on it and then load the java process according to the PID.

Environment: Java 1.8.0_25 under windows 7

+6
source share
1 answer

There is no memory leak. Replicated it also in OSX. This would be the book storage data generated by the normal functioning of the VM, including for the GC. Eden rises, and as soon as the GC occurs, the memory used by the heap (eden) decreases and the cycle starts again.

The confusing aspect is that no objects are created explicitly by the program, but it would be wise to state that the JVM will do this and therefore gradually increase the eden space to the next GC.

+2
source

Source: https://habr.com/ru/post/982925/


All Articles