Elliott
Elliott

Reputation: 208

Do GC pauses and kill -STOP produce the same behavior?

I'm seeing a Java client application crash in the field, and I think it's because the server it's connecting to experienced a 12 second full GC pause. However, when I try to run the client / server locally out of Eclipse and reproduce the behavior using kill -STOP and kill -CONT to simulate a GC pause on the server, I'm not able to get the client application to crash--it just spins until I do kill -CONT.

I'd like to figure out if the GC pause is actually the issue (if not I'll need to dive into the code to see what else could be going on). Is there a difference in behavior between undergoing a long GC pause and receiving kill -STOP followed by kill -CONT?

Upvotes: 3

Views: 390

Answers (1)

Trevor Freeman
Trevor Freeman

Reputation: 7242

There certainly is a difference. At the very least, the garbage collector is operating and parsing objects during a GC pause, and it is not doing so during a kill -STOP.

Furthermore, the garbage collector will be calling finalizers which could potentially be where your crash bug is located, and this behaviour would not be duplicatable via kill -STOP.

Upvotes: 3

Related Questions