I'd like to be able to set a heap size programmatically in Java, and since that doesn't appear to be possible to do at runtime, I'm guessing I'll have to start a new JVM process instead.
Is there a well-defined way to do so, or will I have to hack together something horrible and unmaintainable that will never work on VM implementations that I haven't foreseen? There doesn't seem to be anything in javax.tools
, but perhaps I've missed it in some other package.