开销空堆舞台 [英] overhead for an empty heap arena

查看:111
本文介绍了开销空堆舞台的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工具的Linux,gcc和pthreads的。从多个线程时,我的程序调用新/删除,当出现争用堆,创建舞台的(请参阅下面的链接,以供参考<一个href=\"http://www.bozemanpass.com/info/linux/malloc/Linux_Heap_Contention.html\">http://www.bozemanpass.com/info/linux/malloc/Linux_Heap_Contention.html).我的程序运行的24x7,并且还偶尔被2周后创造的舞台。我觉得有可能最终会尽可能多阿里纳斯的线程。PS(1)显示了惊人的内存消耗,但我怀疑这只是其中的一小部分,实际映射

My tools are Linux, gcc and pthreads. When my program calls new/delete from several threads, and when there is contention for the heap, 'arena's are created (see the following link for reference http://www.bozemanpass.com/info/linux/malloc/Linux_Heap_Contention.html). My program runs 24x7, and arenas are still occasionally being created after 2 weeks. I think there may eventually be as many arenas as threads. ps(1) shows alarming memory consumption, but I suspect that only a small portion of it is actually mapped.

什么是架空了一个空的舞台? (每竞技场如何更多的内存比,如果所有拨款局限于传统的堆使用吗?)

What is the 'overhead' for an empty arena? (How much more memory per arena is used than if all allocation was confined to the traditional heap? )

有没有办法强制提前ñ阿里纳斯的创造?有没有什么办法,迫使空阿里纳斯的破坏?

Is there any way to force the creation in advance of n arenas? Is there any way to force the destruction of empty arenas?

推荐答案

结构malloc_state(又名mstate,又名竞技场描述符)有尺寸

struct malloc_state (aka mstate, aka arena descriptor) have size

的glibc-2.2
    (256 + 18)* 4字节=〜1 KB的32位模式,并〜2 KB的64位模式。
的glibc-2.3
    (256 + 256/32 + 11 + NFASTBINS)* 4 = 1.1-1.2〜KB的32位和2.4-2.5 KB为64

glibc-2.2 (256+18)*4 bytes =~ 1 KB for 32 bit mode and ~2 KB for 64 bit mode. glibc-2.3 (256+256/32+11+NFASTBINS)*4 =~ 1.1-1.2 KB in 32bit and 2.4-2.5 KB for 64bit

请参阅的glibc-X.X.X /的malloc / malloc.c文件,结构malloc_state

See glibc-x.x.x/malloc/malloc.c file, struct malloc_state

这篇关于开销空堆舞台的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆