# HG changeset patch # User poonam # Date 1377148331 25200 # Node ID a70566600baf6977a34d9c48b73119c10798a150 # Parent c6ec0a97b30a41da30c4362e77009f46417ecbfa 8020530: Non heap memory size calculated incorrectly Reviewed-by: coleenp, sla Contributed-by: vladimir.kempik@oracle.com diff -r c6ec0a97b30a -r a70566600baf src/share/vm/services/management.cpp --- a/src/share/vm/services/management.cpp Wed Aug 21 13:18:52 2013 +0200 +++ b/src/share/vm/services/management.cpp Wed Aug 21 22:12:11 2013 -0700 @@ -876,8 +876,6 @@ total_used += u.used(); total_committed += u.committed(); - // if any one of the memory pool has undefined init_size or max_size, - // set it to -1 if (u.init_size() == (size_t)-1) { has_undefined_init_size = true; } @@ -894,6 +892,15 @@ } } + // if any one of the memory pool has undefined init_size or max_size, + // set it to -1 + if (has_undefined_init_size) { + total_init = (size_t)-1; + } + if (has_undefined_max_size) { + total_max = (size_t)-1; + } + MemoryUsage usage((heap ? InitialHeapSize : total_init), total_used, total_committed,