1

Why G1 gives less pause time but lower throughput(lower throughput means GC will be running more total time in seconds)

Per mine understanding as memory is divided into smaller parts, now full has to be run on smaller portion than complete heap . In fact we can say there is no full GC now as its not running on full heap but instead there are multiple background thread running concurrently and clearing first those memory blocks which are containing max number of dead object. So pause time is low.

Throughput is low as bigger memory has been divided in smaller block because of which multiple GC threads has to run on smaller block instead of single block. So it will be kind of busy most of the times

Is that correct ?

Also why G1 is better for heaps larger than 4GB ? I believe it should work better for all heap sizes as it will divide into smaller blocker and pause time will be slow. So why G1 is suggested for heap larger than 4 GB ?

emilly
  • 10,060
  • 33
  • 97
  • 172
  • intuitively i would say that the parallel collector is *asymptotically* more efficient if given potentially very large amounts of additional memory as breathing room to amortize collection costs. in real workloads it may vary which of the two is more efficient and you will have to measure which one is better for you. – the8472 Sep 25 '16 at 14:12

1 Answers1

0

G1 uses concurrently marking live objects but stop-the-world cleanup dead objects. So, the pause time is shorter than stop-the-world GC (e.g. Parallel Scavenge), but longer time to do GC as less resources to do concurrent marking live objects and additional time needed to do remarking live objects (the objects changed during the concurrent marking phase).

JQian
  • 226
  • 2
  • 9