2

Why does htop show two instances of my GUI app TradeClient?

enter image description here

while I started only one instance?

System: Ubuntu 22.04 VPS with X11 (I connect with VNC)

What is its CPU usage?

EDIT1

htop -t

enter image description here

EDIT2

without gdb:

enter image description here

  • 1
    Try htop -t. My guess is that your app is starting a helper thread of some kind. The -t will show which is the parent. – Hack Saw Aug 31 '23 at 15:08
  • 1
    @HackSaw There are multiple threads, see EDIT1 – Alexey Starinsky Aug 31 '23 at 20:27
  • 1
    It's running under gdb? What's it look like when it's not running in a debugger? – Hack Saw Aug 31 '23 at 20:37
  • @HackSaw yes, see EDIT2 – Alexey Starinsky Sep 01 '23 at 04:26
  • @HackSaw I am not sure how threads work on Linux, but on Windows a process with multiple threads has a single PID and is displayed in Task Manager in a single line, but `htop` shows two different PIDs in two separate lines. – Alexey Starinsky Sep 01 '23 at 07:51
  • Yeah, the thing that htop is telling us is that the first instance is the parent of the second instance. That is to say, the parent forked a new process for whatever reason. The thing I'm not sure about is the involvement of gdb, which is running those instances. – Hack Saw Sep 01 '23 at 18:18
  • It is to be noted, though, that apps forking themselves for a variety of reasons is pretty common. In Linux the difference between a thread and a process is whether it shares memory with the parent. Processes have their own memory space. – Hack Saw Sep 01 '23 at 18:20
  • Is this the email client from sourceforge? It appears to fork a bunch of processes to watch various email providers for new messages. – Hack Saw Sep 01 '23 at 18:33

0 Answers0