--- a/hotspot/src/share/vm/services/memTracker.hpp Tue Sep 04 16:20:28 2012 -0700
+++ b/hotspot/src/share/vm/services/memTracker.hpp Tue Sep 11 20:53:17 2012 -0400
@@ -39,7 +39,7 @@
#include "thread_solaris.inline.hpp"
#endif
-#ifdef _DEBUG_
+#ifdef _DEBUG
#define DEBUG_CALLER_PC os::get_caller_pc(3)
#else
#define DEBUG_CALLER_PC 0
@@ -223,12 +223,33 @@
}
}
+ static inline void record_thread_stack(address addr, size_t size, Thread* thr,
+ address pc = 0) {
+ if (is_on()) {
+ assert(size > 0 && thr != NULL, "Sanity check");
+ create_memory_record(addr, MemPointerRecord::virtual_memory_reserve_tag() | mtThreadStack,
+ size, pc, thr);
+ create_memory_record(addr, MemPointerRecord::virtual_memory_commit_tag() | mtThreadStack,
+ size, pc, thr);
+ }
+ }
+
+ static inline void release_thread_stack(address addr, size_t size, Thread* thr) {
+ if (is_on()) {
+ assert(size > 0 && thr != NULL, "Sanity check");
+ create_memory_record(addr, MemPointerRecord::virtual_memory_uncommit_tag() | mtThreadStack,
+ size, DEBUG_CALLER_PC, thr);
+ create_memory_record(addr, MemPointerRecord::virtual_memory_release_tag() | mtThreadStack,
+ size, DEBUG_CALLER_PC, thr);
+ }
+ }
+
// record a virtual memory 'commit' call
static inline void record_virtual_memory_commit(address addr, size_t size,
address pc = 0, Thread* thread = NULL) {
if (is_on()) {
create_memory_record(addr, MemPointerRecord::virtual_memory_commit_tag(),
- size, pc, thread);
+ size, DEBUG_CALLER_PC, thread);
}
}
@@ -237,7 +258,7 @@
Thread* thread = NULL) {
if (is_on()) {
create_memory_record(addr, MemPointerRecord::virtual_memory_uncommit_tag(),
- size, 0, thread);
+ size, DEBUG_CALLER_PC, thread);
}
}
@@ -246,7 +267,7 @@
Thread* thread = NULL) {
if (is_on()) {
create_memory_record(addr, MemPointerRecord::virtual_memory_release_tag(),
- size, 0, thread);
+ size, DEBUG_CALLER_PC, thread);
}
}
@@ -257,7 +278,7 @@
assert(base > 0, "wrong base address");
assert((flags & (~mt_masks)) == 0, "memory type only");
create_memory_record(base, (flags | MemPointerRecord::virtual_memory_type_tag()),
- 0, 0, thread);
+ 0, DEBUG_CALLER_PC, thread);
}
}