hotspot/src/share/vm/gc_implementation/shared/cSpaceCounters.cpp
changeset 29703 0bbea51cbaf8
parent 13728 882756847a04
--- a/hotspot/src/share/vm/gc_implementation/shared/cSpaceCounters.cpp	Wed Mar 25 10:08:09 2015 +0100
+++ b/hotspot/src/share/vm/gc_implementation/shared/cSpaceCounters.cpp	Wed Mar 25 10:13:56 2015 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, 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
@@ -63,3 +63,20 @@
                                      _space->capacity(), CHECK);
   }
 }
+
+void CSpaceCounters::update_capacity() {
+  _capacity->set_value(_space->capacity());
+}
+
+void CSpaceCounters::update_used() {
+  _used->set_value(_space->used());
+}
+
+void CSpaceCounters::update_all() {
+  update_used();
+  update_capacity();
+}
+
+jlong ContiguousSpaceUsedHelper::take_sample(){
+  return _space->used();
+}