--- a/hotspot/src/os/bsd/vm/os_bsd.cpp Tue Mar 05 13:55:56 2013 -0800
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp Thu Mar 07 14:06:44 2013 -0500
@@ -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() {