On Tue, May 12, 2020 at 10:28 AM Patrick Baldwin <pbald...@myersinfosys.com> wrote: > > I've gotten passed an odd (to me, anyway) issue with one of our clients > CentOS systems. > > When our webapp starts running, tomcat dies shortly thereafter with an > OutOfMemoryError. This apparently just started a few days ago. > > System info: > Tomcat Version: Apache Tomcat/7.0.76 > JVM version: 1.8.0_191-b12 > OS: CentOS Linux release 7.6.1810 (Core) [ snip ]
> Since there isn’t a setenv.sh in /usr/local/tomcat/bin, we create one: > 195$ ls -l /usr/local/tomcat/bin/setenv.sh > -rwxrwxrwx. 1 root tomcat 110 May 11 12:56 /usr/local/tomcat/bin/setenv.sh ---------------^^^^^ have the client correct this (owner/runas root) > 45$ cat /usr/local/tomcat/bin/setenv.sh > export CATALINA_OPTS="-server -Xms2048m -Xmx2048m" > export JAVA_OPTS="-XX:PermSize=256m -XX:MaxPermSize=2048m" Does their Tomcat use Systemd? If yes, then look for the Systemd unit file - default should be /etc/systemd/system/tomcat.service .... that's where they will add an entry like (or modify the existing) [ ... ] Environment='CATALINA_OPTS=-server -Xms2048m -Xmx2048m -XX:PermSize=256m -XX:MaxPermSize=2048m' [ ... ] In a pinch, you can check the TC logs to see if the variables are being set. > System memory before starting tomcat: > 188$ free -h "free" doesn't provide a proper memory report for a JVM. If it were me, I'd run *jvisualvm* or *MissionControl* (jmc) or *jconsole*.and get a snapshot of the app. Another option is to use *jmap* or *jcmd* You could also add this option -XX:+HeapDumpOnOutOfMemoryError and optionally this if you want to specify the path of the dump -XX:HeapDumpPath=<file-or-dir-path> ... if you feel like you cant get a proper capture with the GUI tools listed above [ snip ] --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org