Re: Linux and java processes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jan Hudec a écrit :
> On Tue, Aug 23, 2005 at 20:00:03 +0000, Vincenzo Mallozzi wrote:
> 
>>While, the result of "ps -l -C javaprog" is like this:
>>
>>pid    ppid .........
>>510   507   ........
>>511   510  ........
>>512   511  ......
>>
>>Why this happens on Java programs? What is the real program? 
>>I want to underline that, in these examples, I'm not using threads.
> 
> 
> It looks like threads anyway. This is not a matter of Linux, but rather
> a matter of gcj. It may be using threads for garbage collection or something
> even if the program itself does not use them.
> 

  I confirm: the JVM usually used a separate thread as a garbage
collector.

  For the third thread, it is probably the thread for managing the
events (if you use a GUI for example).  It might be something else,
but it depends of your program.

  Also note that it can depends of your JVM implementation.

  For example, SableVM seems smart enought for not using a thread for
garbage collection if there is no needs for it, so your program give
me only one thread.  But on normal non-multithreaded programs it give
me 3 threads likes you.  I get similar results on Solaris with SUN
Java implementation.

  So I guess your JVM always start a thread for the garbage collector
and another one for managing the events regardless if your program
needs it or not.

Simon Valiquette
http://gulus.USherbrooke.ca
http://www.gulus.org


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux