Skip to content

Instantly share code, notes, and snippets.

@enesakar
Created December 30, 2013 13:25
Show Gist options
  • Save enesakar/8182073 to your computer and use it in GitHub Desktop.
Save enesakar/8182073 to your computer and use it in GitHub Desktop.
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