-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Neven,
On 1/28/14, 8:16 AM, Neven Cvetkovic wrote: > On Tue, Jan 28, 2014 at 4:00 AM, Арсений Зинченко > <setev...@gmail.com>wrote: >> >> 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. >> > > Arsenije, > > That's one way of doing it, yes. My personal preference is to > keep system-wide settings empty, and then size each Java process > separately (in their corresponding startup script). Having said > that, it really depends on type of applications you are running on > you system. Are they same type of applications, or are they > significantly different? If different, I probably want to size them > differently, and customize each one of them. Yes, it is easy to set > default values in the JAVA_OPTS globally, but that's rarely what I > want for my applications. +1, in general We have a couple of large-memory servers, and the default heap ergonomics of JVMs have varied wildly. By default, you'll probably get more memory than you actually need, especially for small Java processes. By simply setting JAVA_OPTS to have a small initial and maximum heap size (usually something like 32MiB), we were able to restrict any process that hadn't explicitly set its memory requirements just so things didn't get out of hand. When you give Java a large heap, the JVM assumes that you intend to use it and isn't stingy about allowing it to fill-up. > Also, others pointed out - it is confusing to see both JAVA_OPTS > and CATALINA_OPTS both setting up -Xmx and -Xms values. Ultimately, > everything boils down to a single line: > > java.exe %JAVA_OPTS% %CATALINA_OPTS% ... java.exe -Xmx1G -Xms512M > -Xmx4G -Xms2G ... > > Yes, the later will override former parameter, but I wouldn't count > on it :) I can't find any documentation specifying this behavior, but it's probably reasonable to count on this behavior. Tomcat certainly does ;) > Think if you need to add another Java process that requires 4G, how > would you set the size of memory of that process? > > So, unless all Java applications on that box (you said you had only > few) - are of similar type and require same sizing, I wouldn't use > JAVA_OPTS system-wide setting. +1 That's what bin/setenv.sh and bin\setenv.bat are for. - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJS58TDAAoJEBzwKT+lPKRYQVIQAJNvfHEUEgv3jQFCGZ7R9Dao NqoggAhVaZLmvMLN6GGXnQCzbPvNGCeaAESjo3HPQ+GcCtTeOOAVtgHVDykty7P/ SuKkGDyEfq0aJsMad/7IR7zNel2KYQrfpYx30t5jW+zaiCQ8qKcZ6dnELp1DQGH/ UaK6O28sN39uzMfZMqYwWi2IEJhhblA5qss/XbyC0RPdJPM9mfqvHm8bThykf/3d 1yBTTleZu4X+FEPlMuIFPUvSqOH9GYAmNmPJ2Rr/0/reC1e1WDDp6NknxhJQ/fha 3OWcqptF+oYd44HPKmmrzHpDl/tEmlAaiKtyihTzY7oJxnjatbFvMF7j86VHvZCQ BxyUigAmnw/SWFNWUyDqANcBEpwwfSHecsbCB5vdQwwBj+9vMJLSxmsE71oCFBx7 ZYvo/kgUz6oXmfoNMXJzYFj3e8DFUQSpEZyh0ATe0idMKB1k49A/MyCdEvLisY2/ Qg8hjVYzHTLctkt/D91iBvM2mDDKIvAGz/37l2ryDSQ5yjeWm6t4n3ddsyzTpJRC /Pjs4Od3VhADAGez4RufvPK0qFRAfeo8MrZiR0pnvDW0jf+cJ8fh2XSwtM83o9yG 1XRBRP+4cheUuw90hYvSW6Urux+PnnH3PqzfmQiE+5Zij9HO/IKk60T+Az99VpyS 9nL8JNKIgko8C3mxUPFj =U+u2 -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org