Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 266FA9971 for ; Thu, 7 Jun 2012 20:27:51 +0000 (UTC) Received: (qmail 33210 invoked by uid 500); 7 Jun 2012 20:27:48 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 33022 invoked by uid 500); 7 Jun 2012 20:27:47 -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 33009 invoked by uid 99); 7 Jun 2012 20:27:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jun 2012 20:27:47 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of cerebrotecnologico@gmail.com designates 209.85.214.45 as permitted sender) Received: from [209.85.214.45] (HELO mail-bk0-f45.google.com) (209.85.214.45) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Jun 2012 20:27:42 +0000 Received: by bkwj10 with SMTP id j10so1293920bkw.18 for ; Thu, 07 Jun 2012 13:27:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=CmoM7erHFwVOCnnk9hwkfSjHlcEVOuMNhAF5Dg6hTJg=; b=WtvL6X5X9W4EyDMxoXRVoOPwjWbZdXm1JPjz9Wp9wNyQOK8g5sQ8NmfULbSuhTO08/ ZvPCrfDF2XFonGSR6soB15Q1V2ZSSsL6hroxGTfkaLdfgXjSNQCg7KvaR/ORXPx1MHNw WrKR43AUDCMmRwO1xepERVY/oXcO2OsB101J8XOxARqcs68SnpSw6spK6NjaMEhdn1fR tI/FvnokCSC6ZyGa4cQhZRmQ5RPIACmYqM8EVKRg6inhQitQnVV0Z8Pj53fmMs3PwHZN zY1vzfmHJ1KjluI/HbMwqRQ/XK6jl1kEyjvloCyncNQn0APqpCrllnG2OehSxzCLng+q nJPQ== MIME-Version: 1.0 Received: by 10.205.33.136 with SMTP id so8mr2868154bkb.1.1339100841673; Thu, 07 Jun 2012 13:27:21 -0700 (PDT) Received: by 10.223.157.1 with HTTP; Thu, 7 Jun 2012 13:27:21 -0700 (PDT) In-Reply-To: <18050010.412.1339096070689.JavaMail.daniel@cleveland> References: <18050010.412.1339096070689.JavaMail.daniel@cleveland> Date: Thu, 7 Jun 2012 13:27:21 -0700 Message-ID: Subject: Re: Java process killed by oom-killer in Ubuntu From: Jorge Medina To: Tomcat Users List Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Only 52 java threads. It used to fluctuate more (we made some changes to the app to perform a task in a single thread rather than spawning multiple threads, but the crash still occurs) . The number of threads is always below 100. jstack -F 21370 | grep ^Thread | wc -l ps -T -p 21370 (This gives me 63) I don't seem to specify the -Xss option: Xms6g -Xmx6g -XX:NewSize=3D4G -XX:MaxNewSize=3D4G -XX:SurvivorRatio=3D6 -XX:MaxPermSize=3D512M -XX:-UseConcMarkSweepGC -XX:+UseStringCache -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=3D/home/example/logs -Jorge On Thu, Jun 7, 2012 at 12:07 PM, Daniel Mikusa wrote: > ----- Original Message ----- >> I am using MongoDB through the Java driver allowing up to 100 >> connections to the MongoDB server. >> I also use DBCP with a max size of 50 JDBC connections. >> My webapp uses about 150 JAR files. >> There is no native libraries loaded from my webapp as far as I know. >> All the app is pure Java code. =A0(Nevertheless, Tomcat is using the >> Tomcat Native Library) >> >> Is there a way I can monitor the number of file descriptors in use by >> the app? >> >> I have monitored the number of threads, but I haven't seen anything >> unusual. > > How many threads have you observed? =A0Total threads, not just threads fo= r the connector. > > Also, what is the value you are using for thread stack size? =A0-Xss > > Dan > > > > (but it could be that the burst is too fast to get catch by >> the monitoring tool) >> >> -Jorge >> >> >> >> >> >> >> >> On Thu, Jun 7, 2012 at 11:44 AM, Christopher Schultz >> wrote: >> > -----BEGIN PGP SIGNED MESSAGE----- >> > Hash: SHA1 >> > >> > Jorge, >> > >> > On 6/6/12 5:33 PM, Jorge Medina wrote: >> >> The web application uses Spring/Postgres/Mongo. >> > >> > Are you using MongoDB in-process or anything weird like that? Or >> > are >> > you connecting through some socket-based (or other) API? >> > >> >> It looks like a memory leak in native code, not java code; so my >> >> usual java toolset is not useful. >> > >> > If what you are observing is accurate (non-heap memory grows, heap >> > stays reasonable) then it will definitely be more difficult to >> > track-down. >> > >> >> Tomcat runs behind nginx in a EC2 instance. The application uses >> >> Sun (now Oracle) JDK 1.6. >> >> >> >> Any suggestions on what should I look at? >> > >> > What do your look like? How many JDBC connections do >> > you >> > have in your connection pool (which you are hopefully using!)? How >> > about the same equivalent for MongoDB? >> > >> > Does your webapp keep lots of files open? Do you have an >> > unusually-large number of JAR files in your webapp? Do you have any >> > native libraries in use within your webapp? >> > >> > What are all the non-default system properties that you are setting >> > at >> > JVM launch time (you can easily see this from a 'ps' list)? >> > >> > Two things that can eat-up native memory fast in a JVM are file >> > descriptors and threads, so let's start there. >> > >> > - -chris >> > -----BEGIN PGP SIGNATURE----- >> > Version: GnuPG/MacGPG2 v2.0.17 (Darwin) >> > Comment: GPGTools - http://gpgtools.org >> > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ >> > >> > iEYEARECAAYFAk/Q9ooACgkQ9CaO5/Lv0PDPyQCfVtddxMDOgQbjmMGC3gvnK+Qq >> > aZMAnjVu67+9Sm2bdYzAd91ZOrYo3DFI >> > =3Dr+vl >> > -----END PGP SIGNATURE----- >> > >> > --------------------------------------------------------------------- >> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org >> > For additional commands, e-mail: users-help@tomcat.apache.org >> > >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org >> For additional commands, e-mail: users-help@tomcat.apache.org >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org