LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   a question about Java program on Linux (https://www.linuxquestions.org/questions/programming-9/a-question-about-java-program-on-linux-276292/)

jpan 01-10-2005 06:54 PM

a question about Java program on Linux
 
Hi, i wrote a java program and run it on my linux server.
i did close the program every time, but when i checked
ps -aux ,

i found that there're lots of the "Java myprogram" instance....

anyone knows what's wrong?

tamoneya 01-10-2005 07:35 PM

I don't know exactly what the program does but is it possible that it references it self and possibly runs multiple copies of itslef.

Also try to be more specific: What distro and what does the program do(or is supposed to do)

jlliagre 01-11-2005 02:01 AM

What you see is not due to Java, but to the (somewhat broken) way Linux is implementing threads.
Except maybe on specific experimental versions, Linux threads are more or less processes, each one with its process ID. So each line you see on the ps output represent actually a thread.

Other OSs, e.g. Solaris, do not exhibit this artifact.

jpan 01-11-2005 12:24 PM

so, will it cost too much resource on my linux machine? if yes, how to solve this problem?

jlliagre 01-11-2005 02:46 PM

Switch to Solaris ! :D

zackarya 01-11-2005 06:05 PM

Without knowing the code that your working with, like was said above, it's a thread that is showing up. So it's possible your not stopping some threads that you (or your program) created. You need to make sure to explicitly stop the thread. But without seeing the code that we are talking about I'm just guessing. Also, resources aren't the biggest worries with this. Accidentally having orphaned threads running about your system should be treated like a error and not allowed to happen. Hope that helps.


All times are GMT -5. The time now is 02:52 AM.