LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Java program constantly running in background...how to stop? (https://www.linuxquestions.org/questions/linux-newbie-8/java-program-constantly-running-in-background-how-to-stop-4175650229/)

trumpforprez 03-15-2019 08:05 AM

Java program constantly running in background...how to stop?
 
I have a Debian Jessie OS.
Every time I boot I'm used to seeing no activity on the machine after the boot is complete.
However, now I notice the cpu is active for some reason.

After running the 'top' program from a terminal - it shows there is a 'java' program open which is using about 30% cpu.
What is this program? This doesn't happen when I boot my second Debian OS.

So why is there a program running when I haven't opened up anything?

rtmistler 03-15-2019 08:10 AM

Quote:

Originally Posted by trumpforprez (Post 5974121)
I have a Debian Jessie OS.
Every time I boot I'm used to seeing no activity on the machine after the boot is complete.
However, now I notice the cpu is active for some reason.

After running the 'top' program from a terminal - it shows there is a 'java' program open which is using about 30% cpu.
What is this program? This doesn't happen when I boot my second Debian OS.

So why is there a program running when I haven't opened up anything?

Quote:

What is this program?
This is my exact question for you.

You ran top, and somehow you decided it is a java program.

The name of what you're seeing here would be very helpful to know, as well as the versions of Debian where you see this and where you don't see this, or are they both Debian Jessie? Is this being seen on different systems, or the same one?

trumpforprez 03-20-2019 03:49 AM

Quote:

Originally Posted by rtmistler (Post 5974122)
This is my exact question for you.

You ran top, and somehow you decided it is a java program.

If I run the 'top' program from a terminal- the top program will open up showing various processes running on the OS.
If I am running a web browser: then under the 'COMMAND' tab the program will show 'firefox-esr'. That is the web browser I use.

Under the '%CPU' and '%MEM' tabs the program will show how much resources the browser is using up.

However after I boot my OS - the LED on my desktop flashes intermittently indicating the cpu is going through some activity.
The problem is I haven't opened up any programs - so the OS should be idle.

If then open up the 'top' program - the 'COMMAND' tab shows 'java'is running.
The '%CPU' and '%MEM' tabs show upto 30% cpu is being used up intermittently.

So I need to find out what this java program is.
I need to find out if this is an 'unnecessary' startup program.
Or it is a standard periodic program run by the OS.

I'm wondering if anyone on this forum knows what 'java' indicates on the top program?
Why are system resources being used up when the OS is idle?

ondoho 03-20-2019 02:49 PM

Quote:

Originally Posted by trumpforprez (Post 5975759)
If I run the 'top' program from a terminal- the top program will open up showing various processes running on the OS.
If I am running a web browser: then under the 'COMMAND' tab the program will show 'firefox-esr'. That is the web browser I use.

Under the '%CPU' and '%MEM' tabs the program will show how much resources the browser is using up.

However after I boot my OS - the LED on my desktop flashes intermittently indicating the cpu is going through some activity.
The problem is I haven't opened up any programs - so the OS should be idle.

If then open up the 'top' program - the 'COMMAND' tab shows 'java'is running.
The '%CPU' and '%MEM' tabs show upto 30% cpu is being used up intermittently.

So I need to find out what this java program is.
I need to find out if this is an 'unnecessary' startup program.
Or it is a standard periodic program run by the OS.

I'm wondering if anyone on this forum knows what 'java' indicates on the top program?
Why are system resources being used up when the OS is idle?

you still haven't answered all of rtmistler's questions.

i wonder if top isn't showing you the full command line. it must be more than just 'java'.
please try to tell top to show you the complete command.
or try something else like ps or htop ...

trumpforprez 03-22-2019 06:50 AM

Quote:

Originally Posted by ondoho (Post 5975957)
you still haven't answered all of rtmistler's questions.

Sorry I think I got too pre-occupied with identifying the output on the 'top' program.

Quote:

i wonder if top isn't showing you the full command line. it must be more than just 'java'.
Agreed.

Quote:

please try to tell top to show you the complete command.
or try something else like ps or htop ...
I don't think I have the htop command installed.
Top is showing the 'java' program is owned by 'user' (not root).
'ps -x' as user gives the following output:

Code:

$ ps -x
PID TTY      STAT  TIME COMMAND
 1085 ?        SNl    0:01 /home/userx/Freenet/./bin/wrapper-linux-x86-64 /home/userx/Freenet/./wrapper.
 1090 ?        SNl    8:28 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java -Dnetworkaddress.cache.ttl=0 -
 1193 ?        Ss    0:00 /lib/systemd/systemd --user
 1194 ?        S      0:00 (sd-pam) 
 1198 ?        Sl    0:00 /usr/bin/gnome-keyring-daemon --daemonize --login
 1200 ?        Ssl    0:00 x-session-manager
 1221 ?        Ss    0:00 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session x-session-manager
 1224 ?        S      0:00 /usr/bin/dbus-launch --exit-with-session x-session-manager
 1225 ?        Ss    0:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
 1229 ?        Sl    0:00 /usr/lib/dconf/dconf-service
 1236 ?        Sl    0:01 /usr/bin/mate-settings-daemon
 1238 ?        Sl    0:02 marco
 1243 ?        Sl    0:03 mate-panel
 1247 ?        Sl    0:00 /usr/lib/gvfs/gvfsd
 1253 ?        Sl    0:03 caja
 1256 ?        Sl    0:00 /usr/lib/x86_64-linux-gnu/polkit-mate/polkit-mate-authentication-agent-1
 1259 ?        S<l    0:00 /usr/bin/pulseaudio --start --log-target=syslog
 1263 ?        Sl    0:00 mate-volume-control-applet
 1267 ?        Sl    0:00 nm-applet
 1270 ?        Sl    0:00 mate-screensaver
 1274 ?        Sl    0:00 mate-power-manager
 1276 ?        Sl    0:00 /usr/lib/at-spi2-core/at-spi-bus-launcher
 1281 ?        S      0:00 /usr/bin/dbus-daemon --config-file=/etc/at-spi2/accessibility.conf --nofork -
 1284 ?        Sl    0:00 /usr/lib/at-spi2-core/at-spi2-registryd --use-gnome-session
 1295 ?        Sl    0:05 /usr/lib/mate-panel/wnck-applet
 1304 ?        Sl    0:00 /usr/lib/gvfs/gvfsd-trash --spawner :1.9 /org/gtk/gvfs/exec_spaw/0
 1306 ?        Sl    0:00 /usr/lib/gvfs/gvfs-udisks2-volume-monitor
 1315 ?        S      0:00 /usr/lib/x86_64-linux-gnu/gconf/gconfd-2
 1327 ?        Sl    0:00 /usr/lib/gvfs/gvfs-mtp-volume-monitor
 1333 ?        Sl    0:00 /usr/lib/gvfs/gvfs-gphoto2-volume-monitor
 1366 ?        Sl    0:00 /usr/lib/gvfs/gvfs-afc-volume-monitor
 1371 ?        Sl    0:00 /usr/lib/gvfs/gvfs-goa-volume-monitor
 1379 ?        Sl    0:00 /usr/lib/mate-panel/clock-applet
 1381 ?        Sl    0:00 /usr/lib/mate-panel/notification-area-applet
 1407 ?        S      0:00 /bin/sh /usr/bin/start-pulseaudio-x11
 1408 ?        S      0:00 /usr/bin/xprop -root -spy
 1416 ?        Sl    0:00 /usr/lib/gvfs/gvfsd-metadata
 1481 ?        Rl    0:04 mate-terminal
 1489 ?        S      0:00 gnome-pty-helper
 1490 pts/0    Ss    0:00 bash
  9646 ?        Sl    1:36 firefox-esr
 9693 ?        Sl    0:36 /usr/lib/firefox-esr/firefox-esr -contentproc -childID 1 -isForBrowser -intPr
 9746 ?        Sl    0:03 /usr/lib/firefox-esr/firefox-esr -contentproc -childID 2 -isForBrowser -intPr
10174 ?        Sl    0:02 /usr/lib/firefox-esr/firefox-esr -contentproc -childID 3 -isForBrowser -intPr
10227 ?        Sl    0:00 /usr/lib/firefox-esr/firefox-esr -contentproc -childID 4 -isForBrowser -intPr
10408 pts/0    R+    0:00 ps -x

As you can see it is showing a java program is open.
But what is it doing?

rtmistler 03-22-2019 07:51 AM

Quote:

Originally Posted by trumpforprez (Post 5976474)
Sorry I think I got too pre-occupied with identifying the output on the 'top' program.

Noting that the questions have still not been answered:
Quote:

Originally Posted by rtmistler (Post 5974122)
The name of what you're seeing here would be very helpful to know, as well as the versions of Debian where you see this and where you don't see this, or are they both Debian Jessie? Is this being seen on different systems, or the same one?

These questions are formed to help diagnose your system and determine why you see a difference. If you can't be bothered to diagnose some of this on your own, there's little that your fellow LQ members can do to aid you here.
Quote:

Originally Posted by trumpforprez (Post 5976474)
Code:

1090 ?        SNl    8:28 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java -Dnetworkaddress.cache.ttl=0 -
As you can see it is showing a java program is open.
But what is it doing?

Suggestions from this point:
  1. Web search using java or openjdk and some strings from that ps result.
  2. Search from the root directory, in all files for specific instances of the full path of the executable.
  3. Search the most likely files such as startup files, scripts, the systemD directory, and etc
  4. Kill the process and see if it starts again.

ehartman 03-22-2019 08:35 AM

Quote:

Originally Posted by trumpforprez (Post 5976474)
1090 ? SNl 8:28 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java -Dnetworkaddress.cache.ttl=0 -
As you can see it is showing a java program is open.
But what is it doing?

The commandline is not long enough to show that, it will one of the arguments TO the java program. For instance on my system I've got this commandline:
Code:

/opt/jdk/bin/java -Xmx256m -cp ./Azureus2.jar:./swt.jar -Djava.library.path=/part3/tmp/azureus -Dazureus.install.path=/part3/tmp/azureus -Dazureus.script=./azureus
so what java is executing is the PTP client azureus (also called Vuze).

pan64 03-22-2019 08:41 AM

this (or something similar):
Code:

ps -ef | grep 'java.*network'
will give you the full command line. Can you post it?

trumpforprez 03-22-2019 09:08 AM

Quote:

Originally Posted by rtmistler (Post 5976496)
The name of what you're seeing here would be very helpful to know

I can't find out the full name of the java program let alone identify what it is actually doing.

Quote:

as well as the versions of Debian where you see this and where you don't see this
Code:

$ uname -a
Linux debian3 3.16.0-7-amd64 #1 SMP Debian 3.16.59-1 (2018-10-03) x86_64 GNU/Linux

I have one machine with 2 OSs running in multi-boot. I think the OSs are identical.

However they have different programs installed and different desktop environments.

Quote:

Suggestions from this point:[LIST=1][*]Web search using java or openjdk and some strings from that ps result.
Good idea. I have done this and discovered:

1. I have Freenet installed on the problem OS.
2. Freenet is highly cpu-intensive because it's written in java.
3. Freenet requires java to be installed. I thus have java installed or openjdk.

I do not use Freenet after setting it up some time ago.
So I've come to the conclusion the issue will be remedied if:

a - Freenet is uninstalled
b - java or openjdk is uninstalled.

Do you think this is reasonable?

trumpforprez 03-22-2019 09:12 AM

Quote:

Originally Posted by ehartman (Post 5976503)
so what java is executing is the PTP client azureus (also called Vuze).

That's very interesting.
What cmd did you use? Maybe I could replicate it with similarly illuminating results?

trumpforprez 03-22-2019 09:19 AM

Quote:

Originally Posted by pan64 (Post 5976505)
this (or something similar):
Code:

ps -ef | grep 'java.*network'
will give you the full command line. Can you post it?

This is the output:

Code:

$ ps -ef | grep 'java.*network'
userx    1044  1038 32 13:46 ?        00:11:23 /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java -Dnetworkaddress.cache.ttl=0 -Dnetworkaddress.cache.negative.ttl=0 -Djava.net.preferIPv4Stack=true -Xms60m -Xmx512m -Djava.library.path=lib -classpath wrapper.jar:bcprov-jdk15on-154.jar:freenet-ext.jar:freenet.jar -Dwrapper.key=Xg22cG-EmTMDmybV -Dwrapper.backend=pipe -Dwrapper.disable_console_input=TRUE -Dwrapper.pid=1038 -Dwrapper.version=3.5.20 -Dwrapper.native_library=wrapper -Dwrapper.arch=x86 -Dwrapper.ignore_signals=TRUE -Dwrapper.service=TRUE -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1 freenet.node.NodeStarter freenet.ini
userx    2644  1941  0 14:21 pts/0    00:00:00 grep java.*network

As you can see it has some references to freenet.
Thus I assume I'll need the commands to uninstall freenet and java with their dependencies.

Samsonite2010 03-22-2019 09:25 AM

I would probably start with just uninstalling freenet - java may be used for other things... it is needed to run the uninstaller apparently:

cd ~/Freenet/Uninstaller
java -jar uninstaller.jar

ehartman 03-22-2019 09:53 AM

Quote:

Originally Posted by trumpforprez (Post 5976511)
That's very interesting.
What cmd did you use? Maybe I could replicate it with similarly illuminating results?

Code:

ps -ef | grep java
in a window that was as wide as possible (to get all of the commandline). With a "small" font and a maximum width terminal I can get about 315 chars.
Java commandlines tend to be very long.

pan64 03-22-2019 09:56 AM

you can redirect the output into file and split it (if you wish)

rtmistler 03-22-2019 10:01 AM

I agree with Samsonite2010 try getting rid of freenet. Did you install it on purpose and intend to use it?

Supporting data. Same advice for the uninstall from the Ubuntu forums, https://ubuntuforums.org/showthread.php?t=792676

trumpforprez 03-22-2019 12:08 PM

Quote:

Originally Posted by Samsonite2010 (Post 5976516)
I would probably start with just uninstalling freenet - java may be used for other things... it is needed to run the uninstaller apparently:

cd ~/Freenet/Uninstaller
java -jar uninstaller.jar

Thanks. It would appear that Freenet has been uninstalled - the freenet icon has disappeared from the desktop.

On opening up 'top' - it still shows 'java' is using up system resources.

What is the cmd to remove java-7-openjdk?

pan64 03-22-2019 12:10 PM

you must not remove that I think
but need to check what is running again

Samsonite2010 03-22-2019 12:36 PM

Quote:

Originally Posted by trumpforprez (Post 5976565)
Thanks. It would appear that Freenet has been uninstalled - the freenet icon has disappeared from the desktop.

On opening up 'top' - it still shows 'java' is using up system resources.

What is the cmd to remove java-7-openjdk?

Have you rebooted?

trumpforprez 03-22-2019 12:51 PM

Quote:

Originally Posted by Samsonite2010 (Post 5976577)
Have you rebooted?

Genius. I've rebooted and the java process is removed.

Thank you all!


All times are GMT -5. The time now is 07:47 PM.