public abstract class OutOfMemoryHandler extends Object
OutOfMemoryError is caught by Hazelcast threads,
OutOfMemoryHandler is called for ALL
known by the current JVM (actually ClassLoader).
Warning: OutOfMemoryHandler may not be called even if JVM throws OutOfMemoryError because the error may be thrown from an external (user) thread, so Hazelcast may not be informed about OutOfMemoryError.
|Constructor and Description|
|Modifier and Type||Method and Description|
Decides if the OutOfMemoryError thrown will be handled by this OutOfMemoryHandler or not.
Tries to close the server socket and connections to other HazelcastInstances.
Tries to shutdown HazelcastInstance forcefully; including closing sockets and connections, stopping threads, etc.
public abstract void onOutOfMemory(OutOfMemoryError oome, HazelcastInstance hazelcastInstances)
OutOfMemoryErroris caught by Hazelcast threads, this method is called for ALL
HazelcastInstances knows by current JVM (actually ClassLoader).
User can shutdown the HazelcastInstance, call
just log the error, etc.
The default handler tries to close socket connections to other nodes and shutdown the
Warning: OutOfMemoryHandler may not be called even if JVM throws OutOfMemoryError because the error may be thrown from an external (user) thread and Hazelcast may not be informed about OutOfMemoryError.
public boolean shouldHandle(OutOfMemoryError oome)
onOutOfMemory(OutOfMemoryError, HazelcastInstance)will be called to handle error, otherwise OutOfMemoryError will be ignored.
oome- OutOfMemoryError thrown by JVM
protected final void tryCloseConnections(HazelcastInstance hazelcastInstance)
hazelcastInstance- the Hazelcast instance to close server socket
protected final void tryShutdown(HazelcastInstance hazelcastInstance)
hazelcastInstance- the Hazelcast instance to shutdown
Copyright © 2021 Hazelcast, Inc.. All Rights Reserved.