Not sure if it is the same problem, but i have simply used:java -mx???m ProgramNameFor example:java -mx512m ProgramNameand Virtual Machine allocates 512MB for your program.