tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Caldarale, Charles R" <>
Subject RE: [Tomcat] [daemon] java.lang.OutOfMemoryError unable to create newnative thread
Date Tue, 03 Feb 2009 15:49:18 GMT
> From: Steve Cohen []
> Subject: [Tomcat] [daemon] java.lang.OutOfMemoryError unable
> to create newnative thread
> I have read in some places that this particular form of
> OutOfMemoryError is actually made worse by increasing
> the memory size.

Not memory size, but more specifically, Java heap size.  The Java heap and all the other memory
consumers have to exist inside the process virtual space, which is somewhat limited on 32-bit
systems.  If you expand the Java heap, you reduce the amount left over for other uses (such
as thread stacks) making it somewhat more likely that you'll encounter errors like the above.

You can monitor the state and number of Java threads with JConsole or similar tools.  If your
webapp includes some native code, it might be creating threads that are unknown to the JVM,
so you'll need to watch for those with whatever platfom-specific tools you have available.

Taking periodic JVM thread dumps might also let you know if threads are getting stuck somewhere
and never terminating.  Your webapp might be creating auxiliary threads but not managing them

Of course, it might be some other resource leak that's eating up the process space (e.g.,
an excessive number of open files), and it's just thread creation that happened to get caught.

 - Chuck

P.S. Don't cross-post.

for use only by the intended recipient. If you received this in error, please contact the
sender and delete the e-mail and its attachments from all computers.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message