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
-
Field Summary
Fields inherited from class com.hazelcast.instance.impl.DefaultOutOfMemoryHandler
FREE_MAX_PERCENTAGE_PROP
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
onOutOfMemory
(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.instance.impl.DefaultOutOfMemoryHandler
shouldHandle
Methods inherited from class com.hazelcast.core.OutOfMemoryHandler
tryCloseConnections, tryShutdown
-
Constructor Details
-
ClientOutOfMemoryHandler
public ClientOutOfMemoryHandler()
-
-
Method Details
-
onOutOfMemory
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:
-