JVM memory allocation parameters

The Java virtual machine uses its heap storage for dynamic allocation memory. In addition, each thread requires reserved memory for the stack used to pass method parameters. You can tune the memory used by setting these properties of the EAServer Manager Server Properties dialog box, or by using jagtool. To set these properties, use the syntax documented in their reference pages in Appendix B, “Repository Properties Reference,” in the EAServer System Administration Guide:

The optimum heap size depends on your application and machine configuration. To tune the value, first verify that you have removed any memory leaks from your own code. Then test under expected peak load conditions to determine the minimum size that allows the application to run without errors. If the heap size is too large, it uses memory that could otherwise be used for the call stack required to run each thread. Large heap sizes can also incur a larger delay when the Java garbage collector runs. Never set the heap size larger than the machine’s physical memory; if you do, the system will swap memory to disk. Set the minimum and maximum sizes to equal values, using the syntax described in the reference pages for these properties in the EAServer System Administration Guide, Appendix B, “Repository Properties Reference.”

Set the Java thread stack size to the smallest value that still allows the application to run. Usual values are 256K or 512K for the applications used for internal stress testing at Sybase. Most applications should never require more than 1Mb. The stack must be large enough to accommodate parameters passed in component dispatcher and intercomponent calls. However, if the value is too high, it limits the maximum number of threads that can be spawned. To run N threads, there must at least N x StackSize of free memory available.