You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Caldarale, Charles R" <Ch...@unisys.com> on 2009/02/03 16:49:18 UTC

RE: [Tomcat] [daemon] java.lang.OutOfMemoryError unable to create newnative thread

> From: Steve Cohen [mailto:scohen@javactivity.org]
> 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 properly.

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.


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus 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: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org