LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-10-2005, 06:54 PM   #1
jpan
Member
 
Registered: Aug 2004
Distribution: Debian Libranet
Posts: 69

Rep: Reputation: 15
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?
 
Old 01-10-2005, 07:35 PM   #2
tamoneya
Member
 
Registered: Jan 2005
Location: MA
Distribution: Ubuntu 7.10
Posts: 558

Rep: Reputation: 31
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)
 
Old 01-11-2005, 02:01 AM   #3
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
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.
 
Old 01-11-2005, 12:24 PM   #4
jpan
Member
 
Registered: Aug 2004
Distribution: Debian Libranet
Posts: 69

Original Poster
Rep: Reputation: 15
so, will it cost too much resource on my linux machine? if yes, how to solve this problem?
 
Old 01-11-2005, 02:46 PM   #5
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
Switch to Solaris !
 
Old 01-11-2005, 06:05 PM   #6
zackarya
Member
 
Registered: Jul 2003
Distribution: OpenSuse 10, Debian
Posts: 152

Rep: Reputation: 30
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to compile and run a java program in linux !!!! jmax24 Programming 7 08-06-2010 03:56 AM
Execute a linux command using a java program tvalenzuela Programming 2 10-07-2005 11:59 AM
GIF gone in program when compile Java in Linux dwarf007 Programming 1 09-30-2004 11:15 PM
Problem calling linux program from Java spasco Programming 3 04-25-2004 12:13 AM
What is the best way to call a Java program from a C prog in Linux? renato soffiatt Programming 1 10-17-2003 07:06 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:22 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration