com.hazelcast.instance

## Class OutOfMemoryErrorDispatcher

- java.lang.Object
- - com.hazelcast.instance.OutOfMemoryErrorDispatcher

-     @PrivateApi
      public final class OutOfMemoryErrorDispatcher
      extends Object

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `clearClients()`
    `static void` | `clearServers()`
    `static void` | `deregisterClient(HazelcastInstance instance)`
    `static void` | `deregisterServer(HazelcastInstance instance)`
    `static int` | `getOutOfMemoryErrorCount()` Gets the number of OutOfMemoryErrors that have been reported.
    `static void` | `inspectOutOfMemoryError(Throwable throwable)`
    `static void` | `onOutOfMemory(OutOfMemoryError outOfMemoryError)` Signals the OutOfMemoryErrorDispatcher that an OutOfMemoryError happened.
    `static void` | `registerClient(HazelcastInstance instance)`
    `static void` | `registerServer(HazelcastInstance instance)`
    `static void` | `setClientHandler(OutOfMemoryHandler outOfMemoryHandler)`
    `static void` | `setServerHandler(OutOfMemoryHandler outOfMemoryHandler)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getOutOfMemoryErrorCount

          public static int getOutOfMemoryErrorCount()

      Gets the number of OutOfMemoryErrors that have been reported.
      Returns:
        the number of OutOfMemoryErrors.

    - #### setServerHandler

          public static void setServerHandler(OutOfMemoryHandler outOfMemoryHandler)

    - #### setClientHandler

          public static void setClientHandler(OutOfMemoryHandler outOfMemoryHandler)

    - #### registerServer

          public static void registerServer(HazelcastInstance instance)

    - #### registerClient

          public static void registerClient(HazelcastInstance instance)

    - #### deregisterServer

          public static void deregisterServer(HazelcastInstance instance)

    - #### deregisterClient

          public static void deregisterClient(HazelcastInstance instance)

    - #### clearServers

          public static void clearServers()

    - #### clearClients

          public static void clearClients()

    - #### inspectOutOfMemoryError

          public static void inspectOutOfMemoryError(Throwable throwable)

    - #### onOutOfMemory

          public static void onOutOfMemory(OutOfMemoryError outOfMemoryError)

      Signals the OutOfMemoryErrorDispatcher that an OutOfMemoryError happened.

      If there are any registered instances, they are automatically unregistered. This is done to prevent creating new objects during the deregistration process while the system is suffering from a shortage of memory.
      Parameters:
        `outOfMemoryError` - the out of memory error

Copyright © 2020. All rights reserved.