News for hackers. Stuff that matters.
Re:Why I Don't Use The JVM by jshen on Monday November 14, 2011 @07:33PM (#3236366)
This is on my linux VPS (64bit)

$ java -cp .:servlet-api-2.5.jar:jetty-all-7.0.2.v20100331.jar -client -XX:MaxPermSize=1M -Xmx2M -Xms2M HelloWorld Error occurred during initialization of VM Too small initial heap for new size specified

I can't get it to run in under 30MB RES according to top. This is after hitting it with a little traffic, i'm not sure if you hit yours with any traffic.

Re:Why I Don't Use The JVM by DanielRibeiro on Monday November 14, 2011 @07:46PM (#3236399)
Ah, 64bit JVM. It likes to think it is of itself as enterprise. One thing that may help is -XX:+UseCompressedOops, and even -Xmn1M.

Note that depending on the enverionment it may say it is too small, so you may have to ramp up a bit some of these stats. I also get it if I set lower than then ones I gave.

Note that jvm is very tunnable[1,2]. Also note that you can use a 32 bit jdk in a 64bit machine. It won't get you beyond 2GB vm, but if you are going for small memory, this is not something that matters (and it should allow you to get to a very small memory footprint).

Also note that there are other JVMs, like Oracle's JRockit (with extra memory options[3]), and KVM[4] (designed for small memory footprint[5]).

But hey, that is lower than 32 MB already!

Edit

You can also try some other lesser drastic measures[6,7]. Note that you are getting in less mainstream use of the JVM, and things can get a little crazy in this area.

[1] http://www.oracle.com/technetwork/java/javase/tech/vmoptions...

[2] http://www.caucho.com/resin-3.0/performance/jvm-tuning.xtp

[3] http://download.oracle.com/docs/cd/E15289_01/doc.40/e15060/t...

[4] http://en.wikipedia.org/wiki/K_virtual_machine

[5] http://java.sun.com/products/cldc/wp/

[6] http://www.coderanch.com/t/202896/Performance/java/Ways-redu...

[7] http://stackoverflow.com/questions/4893192/process-memory-vs...

Re:Why I Don't Use The JVM by jshen on Tuesday November 15, 2011 @12:10AM (#3237127)
thanks for the thoughtful replies!
Re:Why I Don't Use The JVM by DanielRibeiro on Tuesday November 15, 2011 @12:32AM (#3237166)
No problem!