Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@jakarta.apache.org Received: (qmail 16842 invoked by uid 500); 29 Aug 2001 03:29:02 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk Reply-To: tomcat-user@jakarta.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 16835 invoked from network); 29 Aug 2001 03:29:01 -0000 Received: from juicer34.bigpond.com (HELO mailin9.bigpond.com) (139.134.6.86) by daedalus.apache.org with SMTP; 29 Aug 2001 03:29:01 -0000 Received: from heproxy ([144.135.24.72]) by mailin9.bigpond.com (Netscape Messaging Server 4.15) with SMTP id GIT8LT00.9PJ; Wed, 29 Aug 2001 13:34:41 +1000 Received: from CPE-144-132-182-182.nsw.bigpond.net.au ([144.132.182.182]) by bwmam02.mailsvc.email.bigpond.com(MailRouter V2.9g 8317/1396745); 29 Aug 2001 13:34:41 Message-ID: <047d01c1303a$3d875400$0400a8c0@nsw.bigpond.net.au> Reply-To: "Max Hugen" From: "Max Hugen" To: Cc: "Jan Horak" References: <20010827081804.P42826-100000@localhost> Subject: Re: OutOfMemory - Set Java Heap Size? Date: Wed, 29 Aug 2001 13:25:23 +1000 Organization: Hugen Enterprises P/L MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Thanks Craig. I'm trying to work out just what I should be doing. 'Fraid I'm rather a novice here. I've used the top command to see what memory is being used (see output below), but I'm not sure what to make of it. I can certainly start the 7th tomcat session on its own, if I don't start the others first, so tomcat settings are ok, I guess. If I understand things correctly, each instance of Tomcat starts its own JVM. The amount of memory each JVM then uses is governed by the starting memory (eg -Xms64m) and then "it consumes as little memory as possible" [from Sun site] until, presumably, it reaches the maximum allowable memory, eg -Xmx256m. The applications I am running are very small, and I don't imagine that they would need a great deal of memory at all. The cpu is idle about 80% most of the time. Does it therefore make sense to use smaller starting memories for the JVMs, such as -Xms32m? If I'm allowing up to 256m maximum, is that across all JVMs, or for each one? Does that mean I can then open 256 / 32 = 8 instances??? Sorry I'm asking so many dumb questions, but I'm having trouble finding the right sort of info on this subject, most of it seems geared towards big applications, and I think I really need to master this, before I rush out and buy another server to run only 6 more tiny applications! Thanks, Max Hugen >>>>>>>>>>>>The console output of the top command>>>>>>>>>>>>>>>>>> 9:42am up 1 day, 14:17, 1 user, load average: 0.15, 0.06, 0.01 271 processes: 270 sleeping, 1 running, 0 zombie, 0 stopped CPU states: 2.9% user, 16.3% system, 0.0% nice, 80.6% idle Mem: 517188K av, 509160K used, 8028K free, 193344K shrd, 75172K buff Swap: 131536K av, 0K used, 131536K free 123504K cached PID USER PRI NI SIZE RSS SHARE STAT LIB %CPU %MEM TIME COMMAND 30036 admin 15 0 1228 1228 880 R 0 17.1 0.2 0:19 top 2385 root 1 0 28144 27M 2516 S 48 1.4 5.4 0:01 java 2347 root 0 0 28144 27M 2516 S 48 0.3 5.4 0:03 java 16308 httpd 0 0 6456 6456 6032 S 0 0.1 1.2 0:00 httpd 1 root 0 0 120 120 48 S 0 0.0 0.0 0:04 init 2 root 0 0 0 0 0 SW 0 0.0 0.0 0:00 kflushd 3 root 0 0 0 0 0 SW 0 0.0 0.0 0:00 kupdate 4 root 0 0 0 0 0 SW 0 0.0 0.0 0:00 kpiod 5 root 0 0 0 0 0 SW 0 0.0 0.0 0:00 kswapd 6 root -20 -20 0 0 0 SW< 0 0.0 0.0 0:00 mdrecoveryd 89 root 0 0 300 300 208 S 0 0.0 0.0 0:02 syslogd 98 root 0 0 416 416 0 S 0 0.0 0.0 0:00 klogd 649 root 0 0 152 152 68 S 0 0.0 0.0 0:00 crond 661 root 0 0 108 108 36 S 0 0.0 0.0 0:00 inetd 670 root 0 0 160 160 0 S 0 0.0 0.0 0:00 nlservd 678 root 0 0 3232 3232 2200 S 0 0.0 0.6 0:00 httpd 713 postgres 0 0 664 664 272 S 0 0.0 0.1 0:01 postmaster >>>>>>>>>>>>>>>>>end>>>>>>>>>>>>>>>>>>>>>>>>>>>> ----- Original Message ----- From: Craig R. McClanahan To: Tomcat Users List ; Max Hugen Sent: Tuesday, August 28, 2001 1:20 AM Subject: Re: OutOfMemory - Set Java Heap Size? On Mon, 27 Aug 2001, Max Hugen wrote: > > Unfortunately, I still cannot launch a 7th Tomcat process, and I don't > understand why not. I feel I'm missing something, but I just can't figure it > out. 6 works, but adding a seventh raises the OutOfMemoryError. Well, have you checked your OS's memory and swap settings yet? Because each JVM uses its own completely separate heap space, it's quite easy to run out of either physical memory or swap space -- once that happens, it doesn't matter how big you set Java's heap size to be, because the OS won't be able to satisfy it anyway. A quick way to check the settings in your 7th setup is to start that one *alone* on the machine. If that works, then there's nothing wrong with your Tomcat settings. If it's really an OS/memory you'll probably have this problem with *whichever* JVM you try to start last. Craig