Without looking at the source, there's no way for us to know what's wrong.

When calling your program with an expanded heap space, you would use the following command line arguments:

Java...