Andrew Welch wrote:
>> I still wonder what values to specify for the -Xms and -Xmx switches
>> on the command line?
> Xmx is the total amount of memory available to Java, and Xms is the
> initial amount taken.
> Xms isn't that important in my experience, as the cost of grabbing
> more heap space isn't noticable. The Xmx switch is the important one
> (max heap size) as when Java hits that it will run the garbage
> collector and if that doesn't reduce memory to less than the available
> heap you'll get an out of memory exception.
> On a system with 12gb you can happily give Java gigabytes of heap and
> it most likely won't even need to run the garbage collector, so you
> should see performance increases there. Equally you can probably
> disable your windows swap space and get benefits from that (although
> with a fast ssd that might be less of an issue).
> Give it a go and see - try a memory hungry transform without setting
> either switch (or as small an Xmx as possible to complete the
> transform, the default 64mb is really small), then run it again with
> -Xmx1024m and then again with -Xms1024m -Xmx1024m. I would expect
> setting Xmx to give a reasonable improvement, and Xms to make little
> to no difference.
An issue I've run into with a large heap size and Java is that garbage
collection can cause slowdowns or even complete lockups until collection
completes. I've been told that the default garbage collector is now
essentially multi-threaded and doesn't just run when the heap is full,
which mitigates most of the problems seen with more primitive GCs that
lock the entire heap until they're done, but on a fairly busy web
application with a 2GB heap I have seen performance drop substantially
when the garbage collection kicks in.
Senior Software Engineer
Visit London Ltd
2 More London Riverside, London SE1 2RR
Tel: +44 (0)20 7234 5848
Fax: +44 (0)20 7234 5753
'Visit London Limited' is registered in England under No.761149;
Registered Office: Visit London, 2 More London Riverside, London SE1 2RR.
Visit London is the official visitor organisation for London. Visit London is partly funded by Partnership, the Mayor's London Development Agency and London Councils.
The information contained in this e-mail is confidential and intended for the named recipient(s) only. If you have received it in error, please notify the sender immediately and then delete the message. If you are not the intended recipient, you must not use, disclose, copy or distribute this email. The views expressed in this e-mail are those of the individual and not of Visit London. We reserve the right to read and monitor any email or attachment entering or leaving our systems without prior notice.
Please don't print this e-mail unless you really need to.