public static void emergencyClose() {
    GemFireCacheImpl.emergencyClose();

    RemoteGfManagerAgent.emergencyClose();

    // If memory was the problem, make an explicit attempt at this point to clean up.
    System.gc();
  }
Attempt to close any and all GemFire resources.

The contract of this method is that it should not acquire any synchronization mutexes nor
create any objects.
<p>
The former is because the system is in an undefined state and attempting to acquire the mutex
may cause a hang.
<p>
The latter is because the likelihood is that we are invoking this method due to memory
exhaustion, so any attempt to create an object will also cause a hang.
<p>
This method is not meant to be called directly (but, well, I guess it could). It is public to
document the contract that is implemented by <code>emergencyClose</code> in other parts of the
system.
geode-core/src/main/java/org/apache/geode/SystemFailure.java