diff --git a/Grid/allocator/MemoryManager.cc b/Grid/allocator/MemoryManager.cc index a9e5c9b4..c71f3512 100644 --- a/Grid/allocator/MemoryManager.cc +++ b/Grid/allocator/MemoryManager.cc @@ -16,6 +16,27 @@ NAMESPACE_BEGIN(Grid); uint64_t total_shared; uint64_t total_device; uint64_t total_host;; + +void MemoryManager::DisplayMallinfo(void) +{ +#ifdef __linux__ + struct mallinfo mi; + + mi = mallinfo(); + + printf("Total non-mmapped bytes (arena): %d\n", mi.arena); + printf("# of free chunks (ordblks): %d\n", mi.ordblks); + printf("# of free fastbin blocks (smblks): %d\n", mi.smblks); + printf("# of mapped regions (hblks): %d\n", mi.hblks); + printf("Bytes in mapped regions (hblkhd): %d\n", mi.hblkhd); + printf("Max. total allocated space (usmblks): %d\n", mi.usmblks); + printf("Free bytes held in fastbins (fsmblks): %d\n", mi.fsmblks); + printf("Total allocated space (uordblks): %d\n", mi.uordblks); + printf("Total free space (fordblks): %d\n", mi.fordblks); + printf("Topmost releasable block (keepcost): %d\n", mi.keepcost); +#endif +} + void MemoryManager::PrintBytes(void) { std::cout << " MemoryManager : ------------------------------------ "<