Sagar
Sagar

Reputation: 5596

young GC pause vs STW pause

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.

Upvotes: 1

Views: 1740

Answers (1)

the8472
the8472

Reputation: 43125

  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

Upvotes: 2

Related Questions