The PS command in linux is unusual because it lists each native thread
of a process as if it were a separate processes.  If you look at the
memory size of all these seemingly different "processes", you'll notice
they are all exactly the same size.  Also if you kill any one of the
"processes" they all go away.

This is actually kind of useful because you can easily check for thread
starvation in your multi threaded app.  Just run "top", while you are
testing.  It's pretty easy to "goof up" and have a large critical
section or a "hot lock" that leads to contention and thread starvation.

-Sam

> You probably get numerous processes because you are using native threads
> with jdk1.3 under linux, and it forks a new process for every thread spawned
> by java. Linux doesn't handle threads like NT and java has to either do it's
> own
> thread handling (green threads using only one process) or put each thread in
> a new process (native threads). I belive you can make threads work better
> with
> the linux-thread path to glibc.

Reply via email to