mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-12-24 11:55:43 +00:00
fixed small prob with memory stuff being wrong
git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@391 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
parent
fbddeac24e
commit
f827842abf
@ -230,11 +230,12 @@ void update_stuff()
|
||||
update_load_average();
|
||||
|
||||
|
||||
if ((NEED(INFO_MEM) || NEED(INFO_BUFFERS)) &&
|
||||
if ((NEED(INFO_MEM) || NEED(INFO_BUFFERS) || NEED(INFO_TOP)) &&
|
||||
current_update_time - last_meminfo_update > 6.9) {
|
||||
update_meminfo();
|
||||
if (no_buffers)
|
||||
if (no_buffers) {
|
||||
info.mem -= info.bufmem;
|
||||
}
|
||||
last_meminfo_update = current_update_time;
|
||||
}
|
||||
|
||||
|
@ -128,6 +128,10 @@ void update_meminfo()
|
||||
|
||||
info.bufmem = info.cached + info.buffers;
|
||||
|
||||
/*if (no_buffers) {
|
||||
info.mem -= info.bufmem;
|
||||
}*/
|
||||
|
||||
info.mask |= (1 << INFO_MEM) | (1 << INFO_BUFFERS);
|
||||
}
|
||||
|
||||
|
@ -495,6 +495,9 @@ void sp_acopy(struct sorted_process *sp_head, struct process ** ar, int max_size
|
||||
}
|
||||
}
|
||||
|
||||
// stole from common.c
|
||||
#define NEED(a) ((need_mask & (1 << a)) && ((info.mask & (1 << a)) == 0))
|
||||
|
||||
/* ****************************************************************** */
|
||||
/* Get a sorted list of the top cpu hogs and top mem hogs. */
|
||||
/* Results are stored in the cpu,mem arrays in decreasing order[0-9]. */
|
||||
@ -513,7 +516,7 @@ inline void process_find_top(struct process **cpu, struct process **mem)
|
||||
update_process_table(); /* update the table with process list */
|
||||
calc_cpu_each(total); /* and then the percentage for each task */
|
||||
process_cleanup(); /* cleanup list from exited processes */
|
||||
update_meminfo();
|
||||
|
||||
cur_proc = first_process;
|
||||
|
||||
while (cur_proc !=NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user