java accepts -Xmx1k happily as an argument, but the "experiments show" is still really something like a heap of 8 MB.
There was nothing to use in Googling, so I'm wondering what is the smallest heap size you can specify in Java?
Thanks Eric
Edit:
It seems to be slightly different in platform and version of java. On my Mac, with 1.6.0_24, the smallest I can configure without errors:
$ java -Xms1k -Xmx4097k -XX:NewSize=192k -cp . Foo 5636096
or around 5.375M, where Foo.java is simply:
public class Foo { public static void main(String[] args) { System.out.println(Runtime.getRuntime().totalMemory()); } }
So my environment is:
$ uname -a Darwin turbo.local 10.7.0 Darwin Kernel Version 10.7.0: Sat Jan 29 15:17:16 PST 2011; root:xnu-1504.9.37~1/RELEASE_I386 i386 $ java -version java version "1.6.0_24" Java(TM) SE Runtime Environment (build 1.6.0_24-b07-334-10M3326) Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02-334, mixed mode)
As I mentioned in a comment below, I set up a small heap, trying to verify that an expensive algorithm doesnโt really use much memory, and not trying to save money.
Thanks for the answers - I was discouraged by how little useful things came when I tried to do this.
source share