You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Neil Gidley <gi...@kpe.com> on 2002/04/06 02:57:42 UTC

java.lang.OutOfMemoryError

Hi,

My website is using the following versions of software:

Struts 1.0.2 
Apache 1.3.22
Tomcat 4.0.2 
Java Runtime Env 1.4
MySQL 3.23.41
RedHat Linux 7.2 using Linux 2.4 kernel

Over a period of time, while running "top" I see memory being eaten up on my box (box has 1GB of RAM). Free memory goes down to about 5-15MB which is way too low.

Occasionally (i.e. once a week or once every two weeks), the site goes down/can't send responses. I see the following error in my /var/tomcat4/logs/catalina.out file:


java.lang.OutOfMemoryError: unable to create new native thread
        at java.lang.Thread.start(Native Method)
        at org.apache.catalina.connector.warp.WarpConnection.start(WarpConnection.java:159)
        at org.apache.catalina.connector.warp.WarpConnector.run(WarpConnector.java:601)
        at java.lang.Thread.run(Thread.java:536)
java.lang.OutOfMemoryError: unable to create new native thread
        at java.lang.Thread.start(Native Method)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.a(DashoA6275)
        at com.sun.net.ssl.internal.ssl.AppOutputStream.write(DashoA6275)
        at java.io.OutputStream.write(OutputStream.java:58)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(DashoA6275)
        at sun.net.www.protocol.https.HttpsClient.afterConnect(DashoA6275)
        at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(DashoA6275)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:556)
        at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:1144)
        at sun.net.www.protocol.http.HttpURLConnection.getResponseCode(HttpURLConnection.java:1158)
        at com.sun.net.ssl.internal.www.protocol.https.HttpsURLConnectionOldImpl.getResponseCode(DashoA6275)
        at com.mandalaybay.actions.ResNetStatus.run(ResNetStatus.java:52)

Once I restart Tomcat, memory is freed up and the site goes along until this error occurs again a week or two later.
Looks like a memory leak, but not sure the real cause. I saw a similar problem which occurred much more frequently  with Tomcat 4.0.2 with JVM 1.3 so I've upgraded to JVM 1.4 and now receive an out of memory problem only sporadically.

Has anyone else encountered this problem?
If not, does anyone have some really good tools/commands which can help determine the cause of the problem?

My JVM settings have default heap size 128MB and max size 256MB by using the following command:
JAVACMD="$JAVA_HOME/bin/java -Xms128m -Xmx256m"


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


RE: java.lang.OutOfMemoryError

Posted by Sven Ewert <sv...@satama.de>.



> -----Ursprüngliche Nachricht-----
> Von: Neil Gidley [mailto:gidleyn@kpe.com]
> Gesendet: Samstag, 6. April 2002 02:58
> An: tomcat-user@jakarta.apache.org
> Betreff: java.lang.OutOfMemoryError
>
>
> Hi,
>
> My website is using the following versions of software:
>
> Struts 1.0.2
> Apache 1.3.22
> Tomcat 4.0.2
> Java Runtime Env 1.4
> MySQL 3.23.41
> RedHat Linux 7.2 using Linux 2.4 kernel
>
> Over a period of time, while running "top" I see memory being
> eaten up on my box (box has 1GB of RAM). Free memory goes down to
> about 5-15MB which is way too low.
>

thats very interesting. ive got nearly the same system-enviroment
(apache 1.3.23)
and got the same problem since im using tomcat 4.

when ive opened a top then i can how the memory usage will grows
on every refesh ...
seem like a bug.

> Has anyone else encountered this problem?
> If not, does anyone have some really good tools/commands which
> can help determine the cause of the problem?

ive switched back to tomcat 3 before one week


sven

---
sven (e)wert
                   !!!           ___
    ()_()     `  _     _  '     <_*_>
    (o o)      -  (OXO)  -      (o o)
ooO--`o'--Ooo-ooO--(_)--Ooo--8---(_)--Ooo-
 (¯`·.¸(¯`·.¸ I`ll greetz you ¸.·´¯)¸.·´¯)
"In a time of insanity, let a madman lead the way"


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>