GUI enhancement

mir

Famous Member
Apr 14, 2012
3,568
127
133
Copenhagen, Denmark
Hi team,

I would suggest a small enhancement in the GUI regarding showing used memory since the current setup misses an important observation, amount of used memory cached.

If the memory readings are as follows for a server with moderate memory requirements:
$ free
total used free shared buffers cached
Mem: 1048576 870592 177984 0 0 703468
-/+ buffers/cache: 167124 881452
Swap: 524288 2676 521612

The GUI would show:
Memoy usage: Total: 1 GB
Used: 850 MB

This would make me login to the server to see whether something wrong. If however the GUI had given me this information also: Cached: 81% I would not have been worried.

My suggestion is therefore:
The GUI would show:
Memoy usage: Total: 1 GB
Used: 850 MB

Cached: 81%
 
The memory usage is read from /proc/meminfo and the GUI takes account of the cache size.

Here's my memory usage:
Code:
# head -n 4 /proc/meminfo 
MemTotal:       16299428 kB
MemFree:         6320520 kB
Buffers:          209444 kB
Cached:          3982960 kB

# free
             total       used       free     shared    buffers     cached
Mem:      16299428    9979032    6320396          0     209444    3982964
-/+ buffers/cache:    5786624   10512804
Swap:     16777208      30504   16746704

The GUI shows
Code:
RAM usage: Total: 15.54GB
                 Used : 5.52GB

The used memory is computed as follows (see /usr/share/perl5/PVE/ProcFSTools.pm):
memfree + buffers + cached = memfree
6320520kB + 209444kB + 3982960kB = 10512924kB
memtotal - memfree = memused
16299428kB - 10512924kB = 5786504kB = 5.52GB
 
What has this to do with the subject of the thread?

The GUI doesn't need to be enhanced since it works correct.

Or did you mean the memory usage of a virtual machine?
If so I can't imagine that this will work since the GUI would have to know every specifics of every operating system that runs under qemu.
 
The GUI doesn't need to be enhanced since it works correct.
Not quit, cached memory is not used memory. Cached memory is released memory to the memory pool governed by the OS.
Or did you mean the memory usage of a virtual machine?
If so I can't imagine that this will work since the GUI would have to know every specifics of every operating system that runs under qemu.
For VM it gives no mening to distinguish between the VM's allocation and handling of memory since this memory cannot be shared anyway but this is quit different from VZ containers where memory sat aside for one VZ container can be allocated to another VZ container or the host if the VZ container has allocated unused memory. This means that the important information is free memory and cached memory since this memory can be allocated to others. I am curtain that the host OS will be able to extract this information from every VZ container.
 
Not quit, cached memory is not used memory. Cached memory is released memory to the memory pool governed by the OS.
And therefore the GUI computes the used memory without the cached memory for the host system.

For VM it gives no mening to distinguish between the VM's allocation and handling of memory since this memory cannot be shared anyway but this is quit different from VZ containers where memory sat aside for one VZ container can be allocated to another VZ container or the host if the VZ container has allocated unused memory. This means that the important information is free memory and cached memory since this memory can be allocated to others. I am curtain that the host OS will be able to extract this information from every VZ container.

You never mentioned VZ container.
I'm not the VZ specialist so I can't help you with that.
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!