Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 69718 invoked from network); 1 Aug 2006 21:52:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 1 Aug 2006 21:52:26 -0000 Received: (qmail 34306 invoked by uid 500); 1 Aug 2006 21:52:13 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 34288 invoked by uid 500); 1 Aug 2006 21:52:13 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 34277 invoked by uid 99); 1 Aug 2006 21:52:13 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Aug 2006 14:52:13 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [63.240.77.85] (HELO sccrmhc15.comcast.net) (63.240.77.85) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Aug 2006 14:52:12 -0700 Received: from [192.168.1.47] (c-69-243-36-80.hsd1.va.comcast.net[69.243.36.80]) by comcast.net (sccrmhc15) with ESMTP id <2006080121515001500lljcae>; Tue, 1 Aug 2006 21:51:50 +0000 Message-ID: <44CFCDB6.20203@christopherschultz.net> Date: Tue, 01 Aug 2006 17:55:02 -0400 From: Christopher Schultz User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) MIME-Version: 1.0 To: Tomcat Users List Subject: Re: cpu 100% java References: <25E9D9B0-E6A7-4278-8CBD-32FBF6BFF120@ambrosiasw.com> In-Reply-To: <25E9D9B0-E6A7-4278-8CBD-32FBF6BFF120@ambrosiasw.com> X-Enigmail-Version: 0.94.0.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigB40FBE1BB11AD37EEA914BB9" X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N --------------enigB40FBE1BB11AD37EEA914BB9 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Ben, > I'm on OS X 10.4.7 running with weblog software (blojsom) > I have to do a kill -9 on java to stop it from using 100+ on cpu > sometimes, to let users connect. I assume that you also have to restart Tomcat at this point, yes? > This comes up over and over in the log: > 2006-08-01 17:22:08 StandardWrapperValve[blojsom]: Servlet.service() fo= r > servlet blojsom threw exception > javax.servlet.ServletException: Servlet execution threw an exception [snip] > ----- Root Cause ----- > java.lang.OutOfMemoryError: Java heap space You done run outta memory. Since this question ("why did I run out of memory") comes up a lot, I'll save you some time going through the gauntlet of one-off responses you are likely to get: 1. Contact the vendor or read their documentation to find out how much memory they recommend for the application (taking into account the number of users, etc.) and check to see that you have your JVM configured have that much memory. If they recommend 128MB and you have 16MB configured, then you might just be running out of memory. 2. If you are meeting the vendor's suggestions for memory usage, but you think that you have an unusual load (number of users, frequency or requests, whatever), then consider increasing your memory /somewhat/ to cover that load. Generally, you don't need to go allocating 4GB of heap space right away... if you do that, you're more likely to put the problem off than anything else. 3. There might be a memory leak. Since you are getting 100% CPU use, you might have found a problem with the software getting it into a tight and infinite loop (or, at least sufficiently many iterations that it may as well be infinite) that generates loads of objects: hence, your memory exhaustion. Make sure you have the latest patches from the vendor. 4. If you added any of your own code, check that out. If you are using a weird JDBC driver, check to see that you have the latest compatible version. In fact, check all your libraries. After that, it's just a matter of changing your memory settings. How you do that depends on your deployment, but generally you set the environment variable JAVA_OPTS and use the "-X" parameters to set the Java heap size. Often, it helps to set the initial and maximum heap sizes to the same thing, so that the memory manager never has to grow the heap during the life of the process -- that can save time and avoid OOMs if Java demands too much memory too fast (I really hope this is fixed in recent versions of the JVM... this used to happen and it really should not). Hope that helps, -chris --------------enigB40FBE1BB11AD37EEA914BB9 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFEz8249CaO5/Lv0PARAnuwAKCBVkhsy6Qe6+vnjkGCvGrWalqNMwCgqtnF rWrmA+DFuzZcdq2RyEBOxwQ= =pWrP -----END PGP SIGNATURE----- --------------enigB40FBE1BB11AD37EEA914BB9--