--- a/hotspot/src/os/bsd/vm/os_bsd.cpp Fri Mar 08 08:22:18 2013 -0800
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp Fri Mar 08 17:14:22 2013 -0800
@@ -57,6 +57,7 @@
#include "runtime/threadCritical.hpp"
#include "runtime/timer.hpp"
#include "services/attachListener.hpp"
+#include "services/memTracker.hpp"
#include "services/runtimeService.hpp"
#include "utilities/decoder.hpp"
#include "utilities/defaultStream.hpp"
@@ -2275,13 +2276,25 @@
return NULL;
}
+ // The memory is committed
+ address pc = CALLER_PC;
+ MemTracker::record_virtual_memory_reserve((address)addr, bytes, pc);
+ MemTracker::record_virtual_memory_commit((address)addr, bytes, pc);
+
return addr;
}
bool os::release_memory_special(char* base, size_t bytes) {
// detaching the SHM segment will also delete it, see reserve_memory_special()
int rslt = shmdt(base);
- return rslt == 0;
+ if (rslt == 0) {
+ MemTracker::record_virtual_memory_uncommit((address)base, bytes);
+ MemTracker::record_virtual_memory_release((address)base, bytes);
+ return true;
+ } else {
+ return false;
+ }
+
}
size_t os::large_page_size() {