1

When young generation GC pause -

  1. Does it stop the application for any amount of time?
  2. Does the application have access to memory during this time?

IIUC in stop the world GC (STW GC) application will be paused and won't have access to memory but wondering about what are side-effects of young gc happens? FYI context - We have recently moved to Java 11 with G1GC and we have a lot of young GCs happening and compared to Java 8.

greg-449
  • 109,219
  • 232
  • 102
  • 145
Sagar
  • 5,315
  • 6
  • 37
  • 66

1 Answers1

2
  1. yes. enable GC or safepoint logging to see the pause times
  2. mostly no. stop-the-world means application threads are paused. JNI code may still run during a GC as long as it does not access object handles and can access off-heap resources
the8472
  • 40,999
  • 5
  • 70
  • 122
  • Just to confirm, both of the above points are for young gc and not for STW, is that correct? – Sagar Apr 19 '19 at 18:04
  • 1
    A young collection in G1 *is* a STW collection. Being STW just describes behavior of a specific collector, not a specific phase or generation. Those are orthogonal and may differ in other collectors. – the8472 Apr 19 '19 at 18:06