From 4312c6c3bce86281716ecc303fad6186fb4ed099 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 1 Jun 2016 13:09:43 -0700 Subject: [PATCH] client: fix memory accounting for VM apps At some point we decided that OS reporting of mem usage for VM apps was wrong, and we use wu.rsc_mem_usage instead. Fix: use this only for running VM apps; for non-running, use zero. Also, in mem usage print (mem_usage_debug) show whether the job is running. --- client/app.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/client/app.cpp b/client/app.cpp index ca43ea6af8..47b36b1348 100644 --- a/client/app.cpp +++ b/client/app.cpp @@ -409,11 +409,7 @@ void ACTIVE_TASK_SET::get_memory_usage() { // the memory of virtual machine apps is not reported correctly, // at least on Windows. Use the VM size instead. // - if (atp->scheduler_state == CPU_SCHED_SCHEDULED) { - pi.working_set_size_smoothed = atp->wup->rsc_memory_bound; - } else { - pi.working_set_size_smoothed = 0; - } + pi.working_set_size_smoothed = atp->wup->rsc_memory_bound; } else { pi.working_set_size_smoothed = .5*(pi.working_set_size_smoothed + pi.working_set_size); } @@ -430,7 +426,8 @@ void ACTIVE_TASK_SET::get_memory_usage() { pi.page_fault_rate = pf/diff; if (log_flags.mem_usage_debug) { msg_printf(atp->result->project, MSG_INFO, - "[mem_usage] %s: WS %.2fMB, smoothed %.2fMB, swap %.2fMB, %.2f page faults/sec, user CPU %.3f, kernel CPU %.3f", + "[mem_usage] %s%s: WS %.2fMB, smoothed %.2fMB, swap %.2fMB, %.2f page faults/sec, user CPU %.3f, kernel CPU %.3f", + atp->scheduler_state==CPU_SCHED_SCHEDULED?"":" (not running)", atp->result->name, pi.working_set_size/MEGA, pi.working_set_size_smoothed/MEGA,