changeset 27292:eb84884dbeaa

8146523: VirtualMemoryTracker::remove_released_region double count unmapped CDS shared memory Summary: Skip tracking release for unmapped CDS shared space. Reviewed-by: dholmes, coleenp, iklam, gtriantafill
author jiangli
date Tue, 12 Jan 2016 19:15:42 -0500
parents 95969ad67bf6
children f1718baeea33
files src/share/vm/services/virtualMemoryTracker.cpp
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/services/virtualMemoryTracker.cpp	Tue Jan 12 21:01:22 2016 +0000
+++ b/src/share/vm/services/virtualMemoryTracker.cpp	Tue Jan 12 19:15:42 2016 -0500
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -416,6 +416,14 @@
     return false;
   }
 
+  if (reserved_rgn->flag() == mtClassShared &&
+      reserved_rgn->contain_region(addr, size) &&
+      !reserved_rgn->same_region(addr, size)) {
+    // This is an unmapped CDS region, which is part of the reserved shared
+    // memory region.
+    // See special handling in VirtualMemoryTracker::add_reserved_region also.
+    return true;
+  }
 
   VirtualMemorySummary::record_released_memory(size, reserved_rgn->flag());