我想看到的是碎片增加我的扭曲服務器的內存使用率的原因。我在這裏發佈了一個問題: How to find the source of increasing memory usage of a twisted server? 現在,我要做的是將堆可視化。我發現了一篇文章:Memory fragmentation。那篇文章中的堆圖像就像我想要的那樣。用matplotlib或其他工具繪製這樣的圖形並不困難
今天我只是想檢查valgrind是如何工作的。所以我創建了一個簡單的程序。 //leak.C
#include<iostream>
class leak
{
int *p;
public:
leak():p(new int[10]()){std::cout<<"Constructor of leak called\n";}
virtual vo