How can I start a Java program with large max heap?
I use a memory hog program (CrashPlan) written in Java, which sometimes, at peak use, needs some 1.5 GB of memory (this is controlled by the parameter -Xmx1500M).
Usually (and at least when starting) it needs very little memory, but with anything lower than -Xmx1500M it crashes at peak use. After start (with -Xmx1000M), Task Manager shows its memory usage about 100 MB in Working Set, Private Set, and Assigned Memory.
However, Java VM cannot start with -Xmx1500M, I guess because it fails to allocate this memory. (With -Xmx1000M it does start, but crashes later on.)
I use Windows 7 pro 32-bit (not 64-bit), with 32 GB memory installed (3 GB accessible, and pagefile on a large RAM disk in inaccessible memory).
I would expect that Windows would swap out other processes in order to allocate memory for Java, and since Java does not use it anyway, would swap Java's unused memory to pagefile. Say, right now I see mydefrag process using 1700 MB allocated set with no problem.
(It seems until last week it worked this way. Then something changed.)
How can I force Java to start with -Xmx1500M?