This is the solution you must eat: it is fixed in Java 1.6.0_23 and above. Runtime.getRuntime (). Exec allocates the same amount of memory for a particular process as for the main process. If you reset the heap size to 1 GB and need to try to run exec, an additional 1 GB will be allocated to run this process. Looks like a bug.