Bug 435899 - plasma-systemmonitor shows wrong memory usage of shell script app that spawns subprocess
Summary: plasma-systemmonitor shows wrong memory usage of shell script app that spawns...
Status: REPORTED
Alias: None
Product: ksystemstats
Classification: Frameworks and Libraries
Component: General (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KSysGuard Developers
URL:
Keywords:
: 435900 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-04-19 02:28 UTC by Lê Hoàng Phương
Modified: 2024-02-08 21:03 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
pycharm in plasma-systemmonitor applications page (106.42 KB, image/png)
2021-04-21 04:15 UTC, Lê Hoàng Phương
Details
pycharm in plasma-systemmonitor processes page (56.57 KB, image/png)
2021-04-21 04:16 UTC, Lê Hoàng Phương
Details
pycharm in ksysguard (108.74 KB, image/png)
2021-04-21 04:16 UTC, Lê Hoàng Phương
Details
systemd-cgls output (21.88 KB, text/plain)
2021-04-22 04:30 UTC, Lê Hoàng Phương
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lê Hoàng Phương 2021-04-19 02:28:12 UTC
SUMMARY
plasma-systemmonitor currently only shows the memory usage of the pycharm.sh script, which is a shell script that starts the actual JVM and loads Pycharm in a subprocess.

STEPS TO REPRODUCE
1. Open Pycharm
2. Open plasma system monitor
3. 

OBSERVED RESULT
System monitor shows memory usage of only the shell script.

EXPECTED RESULT
System monitor shows memory usage of the whole Pycharm's process tree.

SOFTWARE/OS VERSIONS
Operating System: KDE neon 5.21
KDE Plasma Version: 5.21.4
KDE Frameworks Version: 5.81.0
Qt Version: 5.15.2
Kernel Version: 5.8.0-50-generic
OS Type: 64-bit

ADDITIONAL INFORMATION

The script does not use "exec" to replace the script process with the JVM process. If  I manually edit the script to use "exec", then system monitor will show the memory usage correctly.
Comment 1 David Redondo 2021-04-19 08:25:43 UTC
*** Bug 435900 has been marked as a duplicate of this bug. ***
Comment 2 David Edmundson 2021-04-19 08:41:17 UTC
On which page? 
Can you include a screenshot?
Comment 3 Lê Hoàng Phương 2021-04-21 04:15:52 UTC
Created attachment 137747 [details]
pycharm in plasma-systemmonitor applications page
Comment 4 Lê Hoàng Phương 2021-04-21 04:16:25 UTC
Created attachment 137748 [details]
pycharm in plasma-systemmonitor processes page
Comment 5 Lê Hoàng Phương 2021-04-21 04:16:53 UTC
Created attachment 137749 [details]
pycharm in ksysguard
Comment 6 Lê Hoàng Phương 2021-04-21 04:22:03 UTC
In applications page, the memory usage is only for the shell script. 

In processes page, if I filter by "pycharm", it doesn't show the subprocess of the shell script.

I attached the screenshot of pycharm in ksysguard for comparison. Ksysguard shows all the subprocesses of pycharm correctly.
Comment 7 Arjen Hiemstra 2021-04-21 08:59:01 UTC
plasma-systemmonitor should show the same in the processes page if you switch to tree style. That said, please provide the output of `systemd-cgls` when running pycharm, that will provide more information about what's going wrong in the applications page.
Comment 8 Lê Hoàng Phương 2021-04-22 04:30:05 UTC
Created attachment 137780 [details]
systemd-cgls output

Here is the output of systemd-cgls when running pycharm.

> plasma-systemmonitor should show the same in the processes page if you switch to tree style

The screenshot that I uploaded was taken with tree style. Though it seems the filter behavior of this tree is not what I expected. If a parent item matches with the filter keyword, its children should be not be filtered again. But this now becomes off-topic.