views:

130

answers:

2

Something is interrupting threads in my application. It appears to happen when the JVM is close to running out of heap space. I can configure additional heap for the JVM but I'm curious if the garbage collector is interrupting threads in an attempt to reclaim memory. Does anyone know? I am using the 64 bit Java 1.6.0_16 on RedHat ES 5.2.

Thanks,

John

+6  A: 

Interrupt as in throw InterruptedException? No, that shouldn't happen. It may need to pause the thread itself, but that's not the same thing. If the VM runs out of memory completely, it should throw OutOfMemoryError instead...

Jon Skeet
`OutOfMemoryError` actually.
Thomas Pornin
@Thomas: Thanks, fixed.
Jon Skeet
+1  A: 

Unless OutOfMemory happens, Threads will not be interrupted if garbage collection happens. They may go in wait state for sometime.

Fazal