Due to a small implementation mistake I discovered how quickly I could reach a Java heap space issue now the bug is fixed everything is fine but it did get me looking into how to solve this and I foudn multiple solution such as java -Xms5m -Xmx15m MyApp the problem is that this changes the java memory on my computer,