! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
VM-Size displayed is HUGE
Status:
RESOLVED: INVALID
Product:
Xfce4-taskmanager
Component:
General

Comments

Description jsherk 2010-02-05 03:36:57 CET
Running CentOS 5.4 with Xfce 4.4.2 and (I think) Xfce4-taskmananger 0.4.0

When you run Taskmanager is shows some apps with HUGE VM-Size (hundreds of gigabytes) which really don't make sense, like this:
init        VM-Size=2,121,728 kB    RSS= 158 kB
mysqld      VM-Size=142,577,184 kB  RSS=4849 kB
xfdesktop   VM-Size=78,434,384 kB   RSS=2861 kB
xfce4-panel VM-Size=43,651,072 kB   RSS=2321 kB

If you run Top, you can see that it makes more sense that the above Taskmananger VM-Size should probably be in Bytes not in kB. Here is what Top reports:
  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
    1 root      15   0  2072  632  540 S  0.0  0.0   0:00.47 init
 2417 mysql     15   0  135m  18m 4048 S  0.0  0.6   0:00.40 mysqld
 3143 root      15   0 76596  11m 9496 S  0.0  0.3   0:00.12 xfdesktop
 2954 root      15   0 42628 9284 7416 S  0.0  0.3   0:00.14 xfce4-panel

So you can see the difference by comparing the VIRT column of Top to the VM-Size column of Taskmanager.

More here:
http://forum.xfce.org/index.php?topic=5354.0
Comment 1 Mike Massonnet editbugs 2010-02-05 13:40:44 CET
Seems it is totally unsure if you figured the version right.

Run the command "rpm -qa|grep taskmanager" to know, and the latest version has at the bottom-left corner a button from which you can display an about dialog.
Comment 2 jsherk 2010-02-05 13:51:39 CET
rpm command shows:
xfce4-taskmanager-0.4.0-0.2.rc2.el5.centos

And I don't know why I did not see the About under the Preferences button!!!
Comment 3 Mike Massonnet editbugs 2010-02-05 20:32:01 CET
Please attach the stat file of mysql, or xfdesktop f.e., so I can have a close look to the values.

You will find the stat file of a process under /proc/<PID>/stat.

The only thing the code does is parse the VM-Size value as an int, which leaves room up to 2 Tera on 32 bit processors, and when displaying the value it divides it by 1MB (vmsize÷1024÷1024)...
Comment 4 jsherk 2010-02-05 20:38:31 CET
Here is stat file:
27555 (xfce4-taskmanag) S 1 27555 27555 0 -1 4202752 47928 0 0 0 48 45 0 0 16 0 1 0 88153993 39813120 2429 4294967295 134512640 134534744 3214033632 3214033204 4817922 0 0 4 0 0 0 0 17 1 0 0 0
Comment 5 Mike Massonnet editbugs 2010-02-05 20:47:56 CET
Created attachment 2830 
xfce4-taskmanager-0.4.0-rc2-fix-vmsize.patch

The version actually says 0.4.0-rc2. So in reality it is version 0.3.4 with some features, and this bug is already fixed in the latest release (0.4.0 final and up).

What you can do is open a bug at CentOS and propose the attached patch, it fixes your issue.
Comment 6 jsherk 2010-02-06 14:44:31 CET
Ok I opened bug with CentOS here:
http://bugs.centos.org/view.php?id=4189

CentOS has applied the patch and appears to be working now (does not show huge VM-Size anymore).

Although here are a couple more questions:

Top shows this for xfce4-taskmanager:
virt=39504  res=10m   shr=5324

Taskmanager shows this for xfce4-taskmanager:
VM-Size=39832 kB   RSS=2797

How does 'RSS' relate to 'res' or 'shr' (if at all)?

Also, note that top shows 39504 ... is this bytes? 
If so, it would be 39 kB, and taskmanager shows 39832 kB or 39 MB, so there still might be a small problem?

Thanks
Comment 7 Mike Massonnet editbugs 2010-02-08 21:26:21 CET
(In reply to comment #6)
> Ok I opened bug with CentOS here:
> http://bugs.centos.org/view.php?id=4189
> 
> CentOS has applied the patch and appears to be working now (does not show huge
> VM-Size anymore).
> 
> Although here are a couple more questions:
> 
> Top shows this for xfce4-taskmanager:
> virt=39504  res=10m   shr=5324
> 
> Taskmanager shows this for xfce4-taskmanager:
> VM-Size=39832 kB   RSS=2797
> 
> How does 'RSS' relate to 'res' or 'shr' (if at all)?
> 
> Also, note that top shows 39504 ... is this bytes? 
> If so, it would be 39 kB, and taskmanager shows 39832 kB or 39 MB, so there
> still might be a small problem?
> 
> Thanks

The values are all in KiBi, divided by 1024, KBs are divided by 1000. I will fix it in the current code by displaying MiBi and Kibi.

Regarding RSS vs res/shr, it clearly looks messed up. The 10MB value is correct (as showed by top). RES or RSS are the memory in usage (code+data), it includes also the shared memory which is used by the libraries. For example libgtk-2.0 takes around 3~4MB on Linux. When you write a hello world window with GTK+ you will already have a footprint of 5~6MB and if you look at the shared memory you will see that it tops close to this value. You can subtract the value to RES and figure the memory that the application really uses.

So much for the story, I had a look at the source and it actually displays the number of pages in use instead of multiplying them against the page size (which is usually 4KB), which gives us 2797*4K=11456512 which is exactly around 11~10MB.
Comment 8 Mike Massonnet editbugs 2010-02-08 21:30:40 CET
Created attachment 2835 
xfce4-taskmanager-0.4.0-rc2-fix-rss.patch
Comment 9 jsherk 2010-02-09 12:33:28 CET
Is this second patch an RSS fix only, or does it also include the new vm-size fix as well?
Comment 10 Mike Massonnet editbugs 2010-02-09 13:02:14 CET
Created attachment 2839 
xfce4-taskmanager-0.4.0-rc2-fix-rss.patch

Yes, it is a patch for RSS only.

However I didn't test the patch, which was bad because it still was messed up (displayed RSS value was in bytes and not in kibi and an #include was missing). The new patch is tested!

Bug #6210

Reported by:
jsherk
Reported on: 2010-02-05
Last modified on: 2010-02-09

People

Assignee:
Mike Massonnet
CC List:
0 users

Version

Version:
unspecified

Attachments

Additional information