Dear All,

In case it is a duplicate I am sorry I had to send this message again
because it seems it has not arrived to anybody and I have not got in
my inbox too though it appeared in online archives.

I am running Tomcat 8 on Ubuntu. After a few days of running
successfully my Tomcat's JVM crashes or becomes absolutely
unresponsive because of OOME errors similar to this in catalina.out:
--- cut -------
SEVERE:Memory usage is low, parachute is non existent, your system may
start failing.
java.lang.OutOfMemoryError: Java heap space
SEVERE:Memory usage is low, parachute is non existent, your system may
start failing.
java.lang.OutOfMemoryError: Java heap space
SEVERE:Memory usage is low, parachute is non existent, your system may
start failing.
java.lang.OutOfMemoryError: Java heap space
SEVERE:Memory usage is low, parachute is non existent, your system may
start failing.
java.lang.OutOfMemoryError: Java heap space
SEVERE:Memory usage is low, parachute is non existent, your system may
start failing.
java.lang.OutOfMemoryError: Java heap space
SEVERE:Memory usage is low, parachute is non existent, your system may
start failing.
java.lang.OutOfMemoryError: Java heap space: failed reallocation of
scalar replaced objects

Exception: java.lang.OutOfMemoryError thrown from the
UncaughtExceptionHandler in thread "http-nio-80-exec-2"
--- cut -------

I was using a VM with 600MB of RAM. Soon I started having problems
when Linux was killing Tomcat (OOM killer) as it considered its JVM as
a candidate for killing or if I specify a lower maximum heap size I
would eventually get OOME from JVM. I moved to a VM with 1.7GB of RAM
but the problem still occurs eventually though a bit later than on the
600MB VM because I somewhat increased the maximum heap size.

It is strange because my webapp used to run fine on Openshift 512MB
memory VM though it was JRE 1.7 and Tomcat 7. I did not make any
considerable changes to server.xml (with the exception of those
necessary to use Tomcat 8) or app itself, I attach my server.xml too.

I have read Tomcat's FAQ, Wiki pages and searched mailing lists but
nothing seems to fit my case.

I would accept the fact that my application has a memory leak problem
but it is absolutely unclear from this picture that it has one.

I have tried using Eclipse MAT to analyze memory dumps and to see what
might be causing this and it turned out that the majority of heap >
75% is occupied by RequestInfo instances. I would be really grateful
if someone could tell me what might be happening there.

Looking forward to your reply.

Best regards,
Ivan

=============================================================================
My current environment:
VM with 1 CPU which has 1.7GB RAM

Tomcat 8.0.32 (8.0.32-1ubuntu1.5) on Ubuntu 16.04.1.

$ java -version
openjdk version "1.8.0_151"
OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)

$ less /var/lib/tomcat8/bin/setenv.sh
JAVA_OPTS="-Dlog4j.logging.dir=$CATALINA_BASE/logs \
-Dlogging.dir=$CATALINA_BASE/logs \
-Djava.awt.headless=true \
-Xms220M \
-Xmx220M \
-Dsun.java2d.cmm=sun.java2d.cmm.kcms.KcmsServiceProvider \
-Djava.security.egd=file:/dev/./urandom \
-XX:+HeapDumpOnOutOfMemoryError \
-XX:HeapDumpPath=$CATALINA_BASE/logs/java_pid%p.hprof"


Eclipse MAT report
----------------------------------
1,121 instances of "org.apache.coyote.RequestInfo", loaded by
"java.net.URLClassLoader @ 0xf7202b18" occupy 170,358,720 (77.39%)
bytes. These instances are referenced from one instance of
"java.lang.Object[]", loaded by "<system class loader>" - 199MB out of
209MB

server.xml
----------------------------------
<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />

  <Listener className="org.apache.catalina.security.SecurityListener"
minimumUmask="" />
  <Listener className="org.apache.catalina.core.AprLifecycleListener"
SSLEngine="on" />
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"
/>
  <Listener 
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
/>
  <Listener 
className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"
/>

  <Service name="Catalina">

    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
        maxThreads="20" minSpareThreads="4"/>

    <Connector port="80" protocol="HTTP/1.1"
               connectionTimeout="3000"
               redirectPort="443" executor="tomcatThreadPool" />

    <Connector port="443" protocol="org.apache.coyote.http11.Http11NioProtocol"
               maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" executor="tomcatThreadPool"
               KeystoreFile="***" KeystorePass="***"/>

    <Engine name="Catalina" defaultHost="localhost">

      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">

        <Valve className="org.apache.catalina.valves.RemoteIpValve"
            protocolHeader="x-forwarded-proto" ></Valve>


        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html
             Note: The pattern used is equivalent to using pattern="common" -->
        <Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs"
               prefix="localhost_access_log." suffix=".log"
requestAttributesEnabled="true"
               pattern="combined" />

      </Host>
    </Engine>
  </Service>
</Server>

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

Reply via email to