Package com.hazelcast.client
Class ClientOutOfMemoryHandler
- java.lang.Object
-
- com.hazelcast.core.OutOfMemoryHandler
-
- com.hazelcast.instance.impl.DefaultOutOfMemoryHandler
-
- com.hazelcast.client.ClientOutOfMemoryHandler
-
public class ClientOutOfMemoryHandler extends com.hazelcast.instance.impl.DefaultOutOfMemoryHandler
To clear resources of the client upon OutOfMemory
-
-
Constructor Summary
Constructors Constructor Description ClientOutOfMemoryHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onOutOfMemory(java.lang.OutOfMemoryError oome, HazelcastInstance[] hazelcastInstances)
When anOutOfMemoryError
is caught by Hazelcast threads, this method is called for ALLHazelcastInstance
s knows by current JVM (actually ClassLoader).-
Methods inherited from class com.hazelcast.core.OutOfMemoryHandler
tryCloseConnections, tryShutdown
-
-
-
-
Method Detail
-
onOutOfMemory
public void onOutOfMemory(java.lang.OutOfMemoryError oome, HazelcastInstance[] hazelcastInstances)
Description copied from class:OutOfMemoryHandler
When anOutOfMemoryError
is caught by Hazelcast threads, this method is called for ALLHazelcastInstance
s knows by current JVM (actually ClassLoader).User can shutdown the
HazelcastInstance
, callSystem.exit()
, just log the error, etc. The default handler tries to close socket connections to other nodes and shutdown theHazelcastInstance
.Warning:
OutOfMemoryHandler
may not be called even if JVM throwsOutOfMemoryError
because the error may be thrown from an external (user) thread and Hazelcast may not be informed aboutOutOfMemoryError
.- Overrides:
onOutOfMemory
in classcom.hazelcast.instance.impl.DefaultOutOfMemoryHandler
- Parameters:
oome
- OutOfMemoryError thrown by JVMhazelcastInstances
- All HazelcastInstances known by JVM, can include inactive or NULL instances.- See Also:
OutOfMemoryHandler.tryCloseConnections(HazelcastInstance)
,OutOfMemoryHandler.tryShutdown(HazelcastInstance)
-
-