[TriLUG] ulimit violations

Phillip Rhodes mindcrime at cpphacker.co.uk
Fri Jul 15 22:44:04 EDT 2005


Timothy A. Chagnon wrote:

> So aside from the developers doing memory profiling and checking their
> code for unreleased objects, I'm going to look into why Tomcat/Jetspeed
> may not be releasing threads after a certain amount of time passes

Theoretically, true "memory leaks" aren't possible in Java
due to garbage collection. In practice, it is possible to
achieve something that might more properly be called
"unintentional resource retention."

If you are noticing a steady growth in *both* the number of
threads that are alive, and memory, I would suspect a
problem associated with some attempt at thread pooling.  A
poorly implemented thread pool could cause the number of
threads to grow without bound. (Well.. the bound being when
the system crashes).

> On Thu, 2005-07-14 at 19:08 -0400, T. Bryan wrote:
> 
>>java -Xmx95M however_else_you_start_your_app

If number of threads is a problem, you might also
experiment with lowering the stack size. Each
thread is allocated a certain amount of memory
for it's stack...  if you have extremely large #s of
threads, you can save some memory by making the stack
smaller.  The tradeoff is, if you make the stack too
small you may run out of memory for local / automatic
variables, and /or make the system more subject
to StackOverflowError problems.  At any rate, if you
want to experiment with that, the command line
argument, on Sun JVM's anyway, is like this:

java -Xss64k  (for a 64k stack)


TTYL,


Phil
-- 
North Carolina - First In Freedom

Free America - Vote Libertarian
www.lp.org




More information about the TriLUG mailing list