Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 72858 invoked from network); 10 Aug 2010 16:50:46 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 10 Aug 2010 16:50:46 -0000 Received: (qmail 72219 invoked by uid 500); 10 Aug 2010 16:50:42 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 72164 invoked by uid 500); 10 Aug 2010 16:50:41 -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 72114 invoked by uid 99); 10 Aug 2010 16:50:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Aug 2010 16:50:41 +0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [76.96.62.16] (HELO qmta01.westchester.pa.mail.comcast.net) (76.96.62.16) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 10 Aug 2010 16:50:34 +0000 Received: from omta23.westchester.pa.mail.comcast.net ([76.96.62.74]) by qmta01.westchester.pa.mail.comcast.net with comcast id scNm1e0041c6gX851gqEFb; Tue, 10 Aug 2010 16:50:14 +0000 Received: from [192.168.1.201] ([69.143.109.145]) by omta23.westchester.pa.mail.comcast.net with comcast id sgqD1e00M38FjT13jgqEvb; Tue, 10 Aug 2010 16:50:14 +0000 Message-ID: <4C618343.5030506@christopherschultz.net> Date: Tue, 10 Aug 2010 12:50:11 -0400 From: Christopher Schultz User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.8) Gecko/20100802 Thunderbird/3.1.2 MIME-Version: 1.0 To: Tomcat Users List Subject: Re: [OT] Tomcat unexpectedly shuts down References: ,<99C8B2929B39C24493377AC7A121E21F99011AA516@USEA-EXCH8.na.uis.unisys.com>,,<99C8B2929B39C24493377AC7A121E21F99011AA6B5@USEA-EXCH8.na.uis.unisys.com> <4C607F1A.4030802@ice-sa.com> In-Reply-To: <4C607F1A.4030802@ice-sa.com> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 André, On 8/9/2010 6:20 PM, André Warnier wrote: > I must say that your 3000 MB of Heap kind of makes my head spin. What > kind of application are you running that you would think you need as much ? Are you saying that "___ of memory ought to be enough for anyone"? ;) Obviously, /someone/ must need that kind of memory sometimes, otherwise there would be no reason to have machines that can have that amount of memory. Seriously, though, there are a lot of reasons you might want to have a relatively large heap for a webapp: 1. Session data can really pile up, especially if you have a /lot/ of concurren users or large amounts of session data (or both). 3000 simultaneous users (not requests) isn't that crazy. If they all have 1MiB of session data... there you go. Obviously, you can "squeeze the balloon" at either end and the other side grows. 2. Caches. This may be something that is often not considered for a Perl hacker such as yourself, where webapps tend to be scripts that run once and then terminate. Since the servlet context is always available and is (relatively) persistent, the opportunity for caching is quite high. If you can cache static data in the application instead of, say, reading from the database every time, you can improve performance dramatically. Even user-data caches can help quite a bit, whether they go into the session (see above) or the application scope. 3. Per-request data requirements might be high. For instance, if XML documents (notorious memory killers) must be parsed in totum (say, using a DOM parser or the like, rather than streaming, such as with a SAX parser) during the request, the amount of memory needed at any particular moment might be quite large, even though the memory might be freed immediately after the request has been processed. Since one never wants to suffer an OOME, you need to plan for peak service: that is, all 3000 of your users requesting an XML document operation all at once. I'm sure there are other reasons, but those were the ones that immediately came to my mind. In our primary production application, we were running with a 64MiB fixed-size heap for about 5 years. One day, we got an OOME and I freaked out. Subsequent analysis showed that we simply needed a bigger heap to support the growing number of users we were serving (always a positive thing!). We grew to 192MiB, just in case ;) The point is that some webapps, or some webapps in some environments, just need massive amounts of heap space. The data's got to live somewhere, right? - -chris -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkxhg0MACgkQ9CaO5/Lv0PAjzQCgh9+v/0bgJZsIIjl39xEFZWO5 c08AoIqw4icImUllbstvEMMExDQOk8gL =hx4b -----END PGP SIGNATURE----- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org