Chaos Engineering: Simulating OutOfMemoryError This 'java.lang.OutOfMemoryError: Java Heap space' will be thrown by the application when the application generates more objects than the allocated heap size. by Join the DZone community and get the full member experience.Join For Free In the series of chaos engineering articles, we have been learning to simulate various performance problems. In this post, let’s discuss how to simulate 'java.lang.OutOfMemoryError: Java Heap space' problem. This 'java.lang.OutOfMemoryError: Java Heap space' will be thrown by the application when the application generates more objects than the allocated heap size. Sample Program