Garbage Collector Questions

  • I read in a book (Java Efficiency: The Ultimate Guide by Scott Oks) that the collector of young generators is always a stop-world and single-threaded, regardless of which GC algorithm is used. If so, why does this collection of the young generation always take up a negligible the amount of time compared to the collection of the old generation? Is it because the space of the young generation is small compared to the old one? (If so, how is the time spent on the GC related to the heap amount - exponential?)

  • If you have a small value for the initial heap size (-Xms) and a higher upper limit (-Xmx), what happens when the initial limit is reached? Will the JVM make a full GC, or will it grow in heap size until it reaches the -Xmx limit?

+4
source share
1 answer

In the book, I read that the collector of young generators is always in a stop state, regardless of which GC algorithm is used.

more or less yes. But, with the exception of SerialGC, they are multi-threaded, so throwing more cores into the problem makes young collections work faster for the same amount of memory.

, ?

, ,

, ?

, , . , /.

, , GC, - ?

. , . , CPU ( ) GC, . ( ), .

. , , , . , , CPU!= .

(-Xms) (-Xmx), , ? JVM GC , -Xmx?

GC . GC GCViewer

:

oracle/openjdk. JVM . azul zing,

+3

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


All Articles