we have JAVA_OPTS set in catalina.sh 

start_tomcat -> /usr/local/scripts/start_tomcat
stop_tomcat -> /usr/local/tomcat/bin/shutdown.sh

MemTotal:      4149124 kB
MemFree:        381644 kB
Buffers:        106832 kB
Cached:        2377208 kB
SwapCached:          0 kB
Active:        2646596 kB
Inactive:       968884 kB
HighTotal:     3276448 kB
HighFree:       108160 kB
LowTotal:       872676 kB
LowFree:        273484 kB
SwapTotal:     4194288 kB
SwapFree:      4194064 kB

Pid * wrote:
> 
> On 11/11/2011 16:40, celtic man wrote:
>> 
>> Is this JAVA setting below OK ?
>> 
>> cat /proc/meminfo
>> MemTotal:      4149124 kB
>> MemFree:        457884 kB
>> 
>> 4Gb total memory on the linux box and have 0.4GB free memory and
>> tomcat(6.0.18) running with below :
>> 
>> JAVA_OPTS=-Xmx2000M so that i.e 1.9GB ??
>> 
>> or please suggest me the best settings that i add and not have any memory
>> leak issues on the application..
> 
> Please don't top-post.
> 
> No-one can really answer the question you have asked, we don't know
> enough about your application or how much memory it needs to use.
> 
> We can only advise you to avoid bad configuration.  Trying to assign 2Gb
> to a Java process if the OS only has 0.5Gb free beforehand is bad
> configuration.  And maths, it's also Bad Maths.
> 
> 
> 
> If you use JAVA_OPTS to set memory config, (as below), you will create a
> JVM instance with 2Gb of RAM, if you are using the shutdown.sh script
> which will run as well as the existing Tomcat instance.
> 
> Both processes will end up using the swap, be horribly slow & probably
> OOM.
> 
> If you use CATALINA_OPTS, these values are not applied during shutdown
> but are used during startup.
> 
> 
> 
> You have 4Gb of physical RAM.  The amount of memory you can use for
> Tomcat is the amount of free RAM when Tomcat is not running.  If your
> server (without Tomcat) has 2Gb free, then Tomcat can use up to 2Gb.
> 
> The -Xmx and -Xms settings apply to the Object Heap.  The Object Heap is
> only one part of the memory that a Java process consumes.  (The Non-Heap
> area includes the PermGen space, for example.)
> 
> So, with 2Gb free RAM, you may be able to set -Xmx to 1.2Gb (this is a
> guess, not a hard rule).
> 
> You will have to test it yourself to determine what is safe.  Use
> VisualVM or JConsole (both are included with the JDK) to measure
> heap/non-heap usage and compare it to the amount that the OS says the
> process is using.
> 
> 
> p
> 
> 
>> Pid * wrote:
>>>
>>> On 10/11/2011 22:45, Igor Cicimov wrote:
>>>>>
>>>>> JAVA_OPTS=-Xms2048M -Xmx2048M -XX:Permsize=512m -XX:MaxPermsize=512m
>>>>>
>>>>
>>>> You are allocating here 2.5GB of memory to tomcat ... how do you expect
>>>> it
>>>> to start on a box with 2GB in total of which only 500MB are available?
>>>
>>> +1  It's the perfect way to achieve shockingly bad performance.
>>>
>>>
>>> p
>>>
>>>
>>>> On Fri, Nov 11, 2011 at 8:25 AM, Christopher Schultz <
>>>> ch...@christopherschultz.net> wrote:
>>>>
>>>> Celtic,
>>>>
>>>> On 11/10/11 12:02 PM, celtic man wrote:
>>>>>>> So i have updated the setenv.sh with   -Xms2048M -Xmx2048M
>>>>>>> -XX:Permsize=512m -XX:MaxPermsize=512m  and  restarted tomcat..
>>>>
>>>> Where is setenv.sh located? Can you give us the full contents of that
>>>> file?
>>>>
>>>>>>> but when i grep for tomcat process i don't see it ..
>>>>>>>
>>>>>>> ps -ef | grep tomcat root     10959     1 19 14:57 pts/4
>>>>>>> 00:00:29 /appl/java/bin/java -Dnop
>>>>>>> -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
>>>>>>> -Djava.endorsed.dirs=/appl/tomcat/endorsed -classpath
>>>>>>> /appl/tomcat/bin/bootstrap.jar:/appl/tomcat/bin/tomcat-juli.jar
>>>>>>> -Dcatalina.base=/appl/tomcat -Dcatalina.home=/appl/tomcat
>>>>>>> -Djava.io.tmpdir=/appl/tomcat/temp
>>>>>>> org.apache.catalina.startup.Bootstrap start
>>>>
>>>> How are you starting Tomcat? Give us the exact command you are running.
>>>>
>>>> -chris
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>>>>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>>>>
>>>>>
>>>>
>>>
>>> -- 
>>>
>>> [key:62590808]
>>>
>>>
>>>  
>>>
>> 
> 
> 
> -- 
> 
> [key:62590808]
> 
> 
>  
> 

-- 
View this message in context: 
http://old.nabble.com/JVM-config-for-tomcat7.0.19-tp32819635p32827354.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to