The 'age' value can grow only when process terminated.
There is no sence to wait 10 read cycles for process rebirth.
Theoretically, this reduces probability for process data takeover by
another process with same pid.
Issue: #3026
typedef struct procstat_entry_s {
unsigned long id;
- unsigned long age;
+ unsigned char age;
derive_t vmem_minflt_counter;
derive_t vmem_majflt_counter;
pse_prev = NULL;
pse = ps->instances;
while (pse != NULL) {
- if (pse->age > 10) {
+ if (pse->age > 0) {
DEBUG("Removing this procstat entry cause it's too old: "
"id = %lu; name = %s;",
pse->id, ps->name);
pse = pse_prev->next;
}
} else {
- pse->age++;
+ pse->age = 1;
pse_prev = pse;
pse = pse->next;
}