com.hazelcast.client
Class ClientOutOfMemoryHandler

java.lang.Object
  extended by com.hazelcast.core.OutOfMemoryHandler
      extended by com.hazelcast.client.ClientOutOfMemoryHandler

public class ClientOutOfMemoryHandler
extends OutOfMemoryHandler

To clear resources of the client upon OutOfMemory


Nested Class Summary
static class ClientOutOfMemoryHandler.ClientHelper
           
 
Constructor Summary
ClientOutOfMemoryHandler()
           
 
Method Summary
 void onOutOfMemory(OutOfMemoryError oom, HazelcastInstance[] hazelcastInstances)
          When an OutOfMemoryError is caught by Hazelcast threads, this method is called for ALL HazelcastInstances knows by current JVM (actually ClassLoader).
 
Methods inherited from class com.hazelcast.core.OutOfMemoryHandler
inactivate, tryCloseConnections, tryShutdown, tryStopThreads
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientOutOfMemoryHandler

public ClientOutOfMemoryHandler()
Method Detail

onOutOfMemory

public void onOutOfMemory(OutOfMemoryError oom,
                          HazelcastInstance[] hazelcastInstances)
Description copied from class: OutOfMemoryHandler
When an OutOfMemoryError is caught by Hazelcast threads, this method is called for ALL HazelcastInstances knows by current JVM (actually ClassLoader).

User can shutdown HazelcastInstance, call System.exit(), just log the error etc. Default handler tries to close socket connections to other nodes and shutdown HazelcastInstance.

Warning: OutOfMemoryHandler may not be called although JVM throws OutOfMemoryError. Because error may be thrown from an external (user thread) thread and Hazelcast may not be informed about OutOfMemoryError.

Specified by:
onOutOfMemory in class OutOfMemoryHandler
Parameters:
oom - OutOfMemoryError thrown by JVM
hazelcastInstances - All HazelcastInstances known by JVM, can include inactive or NULL instances.
See Also:
OutOfMemoryHandler.inactivate(HazelcastInstance), OutOfMemoryHandler.tryCloseConnections(HazelcastInstance), OutOfMemoryHandler.tryStopThreads(HazelcastInstance), OutOfMemoryHandler.tryShutdown(HazelcastInstance)


Copyright © 2014 Hazelcast, Inc.. All Rights Reserved.