So my program is a chess AI. It works by making a tree for all the possible moves.
The problem is that after a depth of 4, this tree becomes really big. At the starting position, there are only 20 possible moves so it's not that bad, but once the program reaches later in the game, there are closer to 40 possible moves which means the tree is exponentially larger and this causes the error.
I'm also interchangeably getting java.lang.OutOfMemoryError: GC overhead limit exceeded
My question is whether there is a way to either increase the heap size to > 1024 Mb, or get around this issue some other way. Thanks <3