Created
December 30, 2013 13:25
-
-
Save enesakar/8182073 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HazelcastInstance instance = Hazelcast.newHazelcastInstance(); | |
Hazelcast.setOutOfMemoryHandler(new OutOfMemoryHandler() { | |
@Override | |
public void onOutOfMemory(OutOfMemoryError oom, HazelcastInstance[] hazelcastInstances) { | |
for (HazelcastInstance hazelcastInstance : hazelcastInstances) { | |
hazelcastInstance.shutdown(); | |
} | |
System.err.println("danger!!!"); | |
} | |
}); | |
IMap<Object, Object> map = instance.getMap("map"); | |
while(true) { | |
map.put(System.nanoTime(), new Byte[10000]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment