Tuesday 7 August 2007

Memory Hipe

Create below bat file

@echo OFF

set JAVA_OPTIONS=-Xdebug -Xrunjdwp:transport=dt_socket,address=8888,server=y,suspend=n

"%JAVA_HOME%"\bin\java %JAVA_OPTIONS% -Xmx256m -jar org.eclipse.osgi_3.2.2.R32x_v20070118.jar -console

********** Or create enviroment value **********
JAVA_OPTION / -Xmx256m


===== There is another option for it ======================

http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=15&t=000785

You can increase heap size for tomcat by setting an environment variable for that
1. right click on My Computer icon
2. click properties option
3. click advanced tab
4. click Environment Variables button
5. click New button under System Variables
6. type JAVA_OPTS in the Variable Name box
7. type -Xms512m -Xmx128m in the variable value box
8. click Ok and then Ok and then Ok
enjoy …

++++++++++++ incluses heap size of Tomcat +++++++++++++++++

http://www.chemaxon.com/jchem/doc/admin/tomcat.html

Summary
1. Right button click from "my computer" in window explore
2. Click property
3. click advance tab
4. click Enviroment variable
5. create classpath variable
6. variable name > "CATALINA_OPTS"
variable value > "-server -Xmx128m"



3.1 Recommended JVM options
There are two important Java options which should be set for Tomcat.
Maximum heap size: this is the maximum amount of heap memory the Java Virtual Machine (JVM)
is allowed to allocate.
In the case of most JVMs, the default setting of the maximum heap size is 64MB.
You can increase the maximum heap size of applications by setting the -Xmx JVM parameter.
For example -Xmx1024m allows maximum 1GB (1024MB) heap to be allocated for the JVM.

Note: it is recommended to specify a considerably lower value than the amount
of physical RAM in your system,
so the operating system and other applications will also have enough space.
Otherwise the swap memory of the operating system will be used,
which can result in high disk activity, and reduced system performance.

Server mode: server mode instructs the JVM to perform more extensive run-time optimization.
Right after startup it means a slightly slower execution,
but after the JVM had enough time to optimize the code,
the execution will be considerably faster.

3.2 Setting JVM options for Tomcat

Windows running Tomcat 5 and later : Go to the "Apache Tomcat 5.0" folder in the Start Menu.
Start the "Configure Tomcat application".
Note: the configuration can only be started when Tomcat is not running.
Select the "Java VM" tab in the configuration dialog.
You will see some pre-defined lines in the "Java Options" test box.
Append your Java options at the bottom of the option list. For example,
to set server mode and allow 512MB of heap memory, append the following:
-server
-Xmx400m

Windows running Tomcat 4.1 or earlier :
place the Java options into the CATALINA_OPTS environment variable.
To do this, run Control Panel / System, select Environment Variables and
create the CATALINA_OPTS variable,
and set the desired option, for example "-server -Xmx400m".
Linux : place the Java options into the CATALINA_OPTS environment variable.
For example: "-server -Xmx400m".

No comments: