ptmalloc 是glibc的内存分配管理
tcmalloc 是google的内存分配管理模块
jemalloc 是BSD的提供的内存分配管理
写一段代码测试一下
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
extern "C"
{
#include "jemalloc.h"
}
#include <map>
#include <string>
using namespace std;
int main()
{
char *buff = new char[32];
lab_beg:
clock_t begin = clock();
int i = 0;
for(i=0;i<10000000;i++)
{
char *buff = (char *)malloc(1024);
}
map<int, string> map_container;
for(int i=0;i<1000000;i++)
{
map_container.insert(make_pair(i, &