Recovering From Out of Memory Exceptions
This topic describes what happens when GemFire XD runs out of memory.
- Java heap runs out of memory. When the Java heap runs out of memory, threads start throwing an OutOfMemoryError
- System runs out of off-heap memory. In this case, threads start throwing OutOfOffHeapMemoryException
In either case, when threads being throwing out of memory exceptions, GemFire XD closes the cache and disconnects from the distributed system to prevent reading inconsistent data. If your Java heap runs out of memory, you will need to kill and restart your JVM. Any applications or frameworks relying on the JVM must also be shut down and restarted.
If you run out of off-heap memory, you may be able to reuse the existing JVM; however, if you need to modify the configuration of your GemFire XD system, you may need to restart the JVM.
- Check your configuration. You may need to allocate additional heap (using -heap-size) and/or off-heap memory (using -off-heap-size) when starting up your data stores. See server for more information on these command line options.
- Analyze your data. You can view the memory usage for specific tables by querying the SYS.MEMORYANALYTICS table. See Viewing Memory Usage in SYS.MEMORYANALYTICS.