Quote from alanm:
Thanks, skunk, for pointing that out.
If I recall correctly from studying Java's memory model a while back, "lazy programming" and "memory leaks" are generally not applicable to Java in the same way as C++. The nature of Java's model is that the programmer does not explicitly release memory as one does with free() and delete - rather that memory is automatically reclaimed by the garbage collector as needed and as defined by memory management params. Increasing -Xm lets the heap grow bigger until the GC has to run, which may increase performance by spending fewer resources on GC. Unless, of course, you are short of physical memory, in which case it will probably worsen things because the OS ends up having to use swapfile (on disk) to satisfy part of the memory allocation.
AFAIK, as long as the Total Commit Charge stays under Physical Memory (as shown in Task Manager), you're cool. If not, get more memory or reduce the value of -Xm by the amount it is exceeding it (assuming that it's Java, and not something else, that is sucking up a lot of memory).
One further comment -
There are actually two garbage collectors. It seems that the one that releases memory back to the OS (ie calls free () or sbrk ()) is called MarkSweepCompact. It defragments the heap. It is 'expensive' to run, so is rarely called. But if the memory requirements of the application approach the -Xmx limit, it will be frequently run. This will adversely affect performance of the application, so setting -Xmx too small is not a good idea. Unless there is good reason not to, I would leave -Xmx to at least the IB setting.
