Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How often is the GC executed?

Java: How often is the GC executed in JVM? Every second? Every minute? Or is it random depending on the memory size? I just want to have an idea.

Thank you.

like image 414
Reacen Avatar asked Aug 02 '11 08:08

Reacen


1 Answers

It depends on the memory usage and the heap in which the objects are stored. Look at this

http://javarevisited.blogspot.com/2011/04/garbage-collection-in-java.html

It does not depend on time. It only depends on the new memory requirements and available memory.

like image 171
Sumit Avatar answered Nov 15 '22 18:11

Sumit