Process monitors: Htop vs. Top view

Using applications, configuring, problems
Post Reply
Message
Author
Dewbie

Process monitors: Htop vs. Top view

#1 Post by Dewbie »

I've noticed a sizable difference in displayed memory usage, pretty much every time, even with different Puppies.

Which one is more accurate?
Should I just add 'em up and divide by two? :lol:
Attachments
htop-vs-top_view.png
(5.45 KiB) Downloaded 271 times

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#2 Post by mikeb »

depends if caching is included or not and such....l only have the RES column showing in htop.

I do find the htop figure matches the one I get from the xfce4 memory monitor so I go with that...its also accurate when the stuff accidentally gets filled up (open a videofile in a test editor :D )

mike

User avatar
nic007
Posts: 3408
Joined: Sun 13 Nov 2011, 12:31
Location: Cradle of Humankind

#3 Post by nic007 »

The memory section of Hardinfo system information gives the best break down of memory usage that I've seen.

User avatar
Moat
Posts: 955
Joined: Tue 16 Jul 2013, 06:04
Location: Mid-mitten

#4 Post by Moat »

mikeb wrote:I do find the htop figure matches the one I get from the xfce4 memory monitor so I go with that...
I find htop to match what I'm seeing in LXtask and LXpanel's memory meter, as well. Top might be displaying virtual memory vs. how much physical RAM is actually in use (RSS?)...??

Score -

htop = 2

top = 0

:)

npierce
Posts: 858
Joined: Tue 29 Dec 2009, 01:40

#5 Post by npierce »

As mikeb said, it depends upon what is included in the value.

The memory data provided by the htop utility is actually consistent with the memory data provided by the top utility. The problem is that it is labeled incorrectly by htop.

Pressing F1 for help in htop shows the format of the "memory meter":

Code: Select all

Memory bar:    [used/buffers/cache                            used/total]
Swap bar:      [used/buffers/cache                            used/total]
Type and layout of header meters are configurable in the setup screen.
Memory is either in use or it is free. So total memory minus free memory equals used memory. The confusion results from the fact that the htop utility uses its own definition for "used" memory. Because some of the memory which is in use by the kernel for cache or buffers can be released by the kernel if processes need more memory, the author of htop decided to (by default) display only the memory used by processes, not cache or buffers, and feels that "the number displayed by htop is a more meaningful metric of resources used". He may be right that it is more meaningful, but should have given it a better label, since that memory is not the only memory being used. Calling it simply "used" causes confusion.

In some Puppies, entering this command will bring you to the htop web pages:

Code: Select all

man htop
Here is a paragraph from the F.A.Q. page found there:
htop: Frequently Asked Questions wrote:The number showed by the memory meter is the total memory used by processes. The additional available memory is used by the Linux kernel for buffering and disk cache, so in total almost the entire memory is in use by the kernel. I believe the number displayed by htop is a more meaningful metric of resources used: the number corresponds to the green bars; the blue and brown bars correspond to buffers and cache, respectively (as explained in the Help screen accessible through the F1 key). Numeric data about these is also available when configuring the memory meter to display as text (in the Setup screen, F2).
In the attached screenshot you can see that I've added a second "memory meter" to display values for buffers and cache, as mentioned in the quoted paragraph.
Attachments
htop_with_numeric_mm.png
htop after adding a numeric "memory meter"
(9.69 KiB) Downloaded 198 times

Dewbie

#6 Post by Dewbie »

Thanks for the replies. :)

npierce wrote:
He may be right that it is more meaningful, but should have given it a better label, since that memory is not the only memory being used. Calling it simply "used" causes confusion.

Exactly. It would be less confusing if Htop used actual numbers for used/buffers/cache/total.

Top view apparently considers total as "used."

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#7 Post by mikeb »

Have we all been 'used' then :D

mike

Post Reply