< prev index next >

src/hotspot/share/services/virtualMemoryTracker.cpp

Print this page




   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 #include "precompiled.hpp"
  25 
  26 #include "logging/log.hpp"
  27 #include "memory/metaspace.hpp"
  28 #include "runtime/atomic.hpp"
  29 #include "runtime/os.hpp"
  30 #include "runtime/threadCritical.hpp"
  31 #include "services/memTracker.hpp"
  32 #include "services/threadStackTracker.hpp"
  33 #include "services/virtualMemoryTracker.hpp"
  34 
  35 size_t VirtualMemorySummary::_snapshot[CALC_OBJ_SIZE_IN_TYPE(VirtualMemorySnapshot, size_t)];
  36 
  37 void VirtualMemorySummary::initialize() {
  38   assert(sizeof(_snapshot) >= sizeof(VirtualMemorySnapshot), "Sanity Check");
  39   // Use placement operator new to initialize static data area.
  40   ::new ((void*)_snapshot) VirtualMemorySnapshot();
  41 }
  42 
  43 void VirtualMemorySummary::snapshot(VirtualMemorySnapshot* s) {
  44   // Only if thread stack is backed by virtual memory
  45   if (ThreadStackTracker::track_as_vm()) {
  46     // Snapshot current thread stacks
  47     VirtualMemoryTracker::snapshot_thread_stacks();
  48   }




   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 #include "precompiled.hpp"
  25 
  26 #include "logging/log.hpp"
  27 #include "memory/metaspace.hpp"

  28 #include "runtime/os.hpp"
  29 #include "runtime/threadCritical.hpp"
  30 #include "services/memTracker.hpp"
  31 #include "services/threadStackTracker.hpp"
  32 #include "services/virtualMemoryTracker.hpp"
  33 
  34 size_t VirtualMemorySummary::_snapshot[CALC_OBJ_SIZE_IN_TYPE(VirtualMemorySnapshot, size_t)];
  35 
  36 void VirtualMemorySummary::initialize() {
  37   assert(sizeof(_snapshot) >= sizeof(VirtualMemorySnapshot), "Sanity Check");
  38   // Use placement operator new to initialize static data area.
  39   ::new ((void*)_snapshot) VirtualMemorySnapshot();
  40 }
  41 
  42 void VirtualMemorySummary::snapshot(VirtualMemorySnapshot* s) {
  43   // Only if thread stack is backed by virtual memory
  44   if (ThreadStackTracker::track_as_vm()) {
  45     // Snapshot current thread stacks
  46     VirtualMemoryTracker::snapshot_thread_stacks();
  47   }


< prev index next >