mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-27 04:32:55 +00:00
Fix formatting, remove bad line.
This commit is contained in:
parent
c2c9e07afc
commit
91a3f2ed87
34
src/linux.cc
34
src/linux.cc
@ -247,26 +247,26 @@ int update_meminfo(void) {
|
|||||||
*/
|
*/
|
||||||
curmem -= curbufmem;
|
curmem -= curbufmem;
|
||||||
cureasyfree += curbufmem;
|
cureasyfree += curbufmem;
|
||||||
#else
|
#else /* LINUX_VERSION_CODE <= KERNEL_VERSION(3, 14, 0) */
|
||||||
# curmem = info.memmax - memavail;
|
|
||||||
/* The memory available field is describe in /proc man page as :
|
/* The memory available field is describe in /proc man page as :
|
||||||
* "An estimate of how much memory is available for starting new applications, without swapping."
|
* "An estimate of how much memory is available for starting new
|
||||||
* We can see in page_alloc.c in the linux kernel that :
|
* applications, without swapping." We can see in page_alloc.c in the linux
|
||||||
* "Not all the page cache can be freed, otherwise the system will start swapping.
|
* kernel that : "Not all the page cache can be freed, otherwise the system
|
||||||
* Assume at least half of the page cache, or the low watermark worth of cache, needs to stay."
|
* will start swapping. Assume at least half of the page cache, or the low
|
||||||
* There is a difference between the system starts swapping and OOM happens even if there is no swap
|
* watermark worth of cache, needs to stay." There is a difference between
|
||||||
* on the system.
|
* the system starts swapping and OOM happens even if there is no swap on
|
||||||
* People think they will find the same amount of used RAM with the free program.
|
* the system. People think they will find the same amount of used RAM with
|
||||||
* From man free, we can see :
|
* the free program. From man free, we can see : used Used memory
|
||||||
* used Used memory (calculated as total - free - buffers - cache)
|
* (calculated as total - free - buffers - cache) free Unused memory
|
||||||
* free Unused memory (MemFree and SwapFree in /proc/meminfo)
|
* (MemFree and SwapFree in /proc/meminfo) buffers Memory used by kernel
|
||||||
* buffers Memory used by kernel buffers (Buffers in /proc/meminfo)
|
* buffers (Buffers in /proc/meminfo) cache Memory used by the page cache
|
||||||
* cache Memory used by the page cache and slabs (Cached and SReclaimable in /proc/meminfo)
|
* and slabs (Cached and SReclaimable in /proc/meminfo) So, curmem should be
|
||||||
* So, curmem should be calculate as follow to find the same amount of memory in conky and free.
|
* calculate as follow to find the same amount of memory in conky and free.
|
||||||
*/
|
*/
|
||||||
curmem = info.memmax - (info.memfree + info.buffers + info.cached + sreclaimable);
|
curmem = info.memmax -
|
||||||
|
(info.memfree + info.buffers + info.cached + sreclaimable);
|
||||||
cureasyfree += curbufmem;
|
cureasyfree += curbufmem;
|
||||||
#endif
|
#endif /* LINUX_VERSION_CODE <= KERNEL_VERSION(3, 14, 0) */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now that we know that every calculation is finished we can wrap up
|
/* Now that we know that every calculation is finished we can wrap up
|
||||||
|
Loading…
Reference in New Issue
Block a user