A lot of thanks, Neven! This is perfect explanation - considering my English :-)
About point 4 - this is main goal: as we have few Java-applications running in this very system - they must use "global" memory options, thats why I suggested set System variable JAVA_OPTS. But namely Tomcat - must use another memory perametrs. So, if I correctly understood - for me better solution will be: 1) set CATALINA_OPTS with Xmx4G etc - in /bin/setenv.bat; 2) set JAVA_OPTS with Xmx1G etc - as system variable. Yep? 2014/1/28 André Warnier <a...@ice-sa.com> > Арсений Зинченко wrote: > >> OK, thanks - I'll do it from now (really - never used this file before, >> just now found reference to it in catalina.bat) . But - last question, >> please: in setenv.bat - must be used CATALINA_OPTS or JAVA_OPTS? >> >> > Ok, let us be really clear here. > > 1) The command to *stop* Tomcat starts *another* instance of Java JVM (and > Tomcat), *just* to send a stop signal to the running Tomcat. And after > that, this second instance of Java and Tomcat exits. > > 2) Options given in JAVA_OPTS are used in *both* the command to start and > to stop Tomcat. > Options given in CATALINA_OPTS are used *only* in the command that starts > Tomcat, and not in the command that stops Tomcat. > In other words : > - startup.(bat|sh) : java %JAVA_OPTS% %CATALINA_OPTS% tomcat-stuff > - shutdown.(bat|sh) : java %JAVA_OPTS% tomcat-stuff > > That is just the way that these command files are written. > > 3) So, > - if you use JAVA_OPTS to indicate a Heap of 4 GB, then this Heap of 4 GB > will be allocated : > - for the JVM instance that starts and runs Tomcat (which is what you > want) > - but *also* for the JVM instance that stops Tomcat (which you probably > do not want, just to send a stop signal)(because then, just for a short > moment, you need 4 + 4 = 8 GB of Heap) > > - if you use CATALINA_OPTS to indicate a Heap of 4 GB, then this Heap will > be allocated > - *only* for the JVM instance which starts and runs Tomcat > - and *not* for JVM instance that stops Tomcat (that one will use a > minimal Heap, so the total would be only 4 + 0.1 GB) > > 4) and if you make either one of the above be a general "system variable", > then they will be used by *any* Java JVM that you start on that system. > This is probably not what you want either, so don't do that. > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >