Greetings.

Try the following settings:

-Xms220m -Xmx1024m 

To allow for memory allocation on the native heap.  

Have you looked at your SHM* settings for the Linux kernel?

Carl

-----Original Message-----
From: Jim Van Fleet [mailto:[EMAIL PROTECTED] 
Sent: 15 July 2004 05:08 PM
To: [EMAIL PROTECTED]
Subject: Memory settings and thread management

I'm in a little over my head with a task I've got brewing in production
land.  I'm a junior developer that was hired to be an entire team.

Roughly ten times as many people are registered to use the project than I
was told, so I purchased more RAM.  That makes the machine stats these.

Pentium IV 2.4Ghz
2GB DDR ECC RAM
Debian Linux 2 stable
Tomcat 4.1.30

A segment of the system is designed to send e-mail to everyone on a list.
Each e-mail is sent by starting a thread that terminates when the sending is
complete.  The upper bound of emails in this list is about a thousand, but
will rarely exceed five hundred.  The system was running as expected (e.g.
capable of sending multiple hundreds of messages) before at 512MB of RAM
with the following options appended to JAVA_OPTS in catalina.sh

-Xms 220M -Xmx 440M

Now that the products have gotten the RAM upgrade, I changed these options
to

-Xms220m -Xmx1536m

The result was a drop to about forty messages before I got an "Out of
Memory- unable to start new native thread" error.

As a result of looking around, particularly at the links like
http://h21007.www2.hp.com/cmdspp/QuestionAnswer/1,1764,4AF428BF-32E1-4297-93
8A-0A1F93DE31B1,00.html
and
http://jboss.org/wiki/Wiki.jsp?page=OutOfMemoryExceptionWhenCannotCreateThre
ad

I changed the options to these

-Xss1024K -Xms1536m -Xmx1536m

but this only gets the boundary to about one hundred before thread creation
fails.  We're nowhere near the process limit for Linux, running at
approximately 400 or so.

Should I just keep tweaking the configuration settings hoping to find
something that works?  Give up a little bit more maximum heap size?  The one
similar post I've seen since March had the user going down to 16k stack
size.  Is that safe?  I can't be blowing my stack on the production machine,
that's worse than the problem I have now!  I don't have any recursion going
on, but I've seen some pretty deep stack traces.

Is there something programmatically I could do, like having the call that
starts the thread wait for awhile then try again if it fails?

I've tried to do my homework, but I think I actually passed my limits on
this project some time ago.  :-) Thanks and good karma in advance for any
and all help.


Cheers,

Jim


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to