【发布时间】:2018-06-15 08:32:36
【问题描述】:
我正在调用 malloc_info(3) 并获取 XML 输出。
我在网上找到的所有内容都表明“这可能会发生变化,我们不会费心记录它”。
但这对于调查潜在内存碎片问题的人来说并不是非常有用。
这里有一些sn-ps:
<malloc version="1">
<heap nr="0">
<sizes>
<size from="257" to="257" total="257" count="1"/>
</sizes>
<total type="fast" count="0" size="0"/>
<total type="rest" count="1" size="257"/>
<system type="current" size="303104"/>
<system type="max" size="303104"/>
<aspace type="total" size="303104"/>
<aspace type="mprotect" size="303104"/>
</heap>
<heap nr="1">
<sizes>
<size from="17" to="32" total="96" count="3"/>
<!-- etc. -->
<size from="10609" to="10609" total="10609" count="1"/>
<unsorted from="145" to="209" total="740" count="4"/>
</sizes>
<total type="fast" count="95" size="7328"/>
<total type="rest" count="2633564" size="112589836"/>
<system type="current" size="2032623616"/>
<system type="max" size="2032947200"/>
<aspace type="total" size="19451904"/>
<aspace type="mprotect" size="19775488"/>
</heap>
等等,等等,直到……
<heap nr="27">
<sizes>
</sizes>
<total type="fast" count="0" size="0"/>
<total type="rest" count="0" size="0"/>
<system type="current" size="32768"/>
<system type="max" size="32768"/>
<aspace type="total" size="32768"/>
<aspace type="mprotect" size="32768"/>
</heap>
<total type="fast" count="4232" size="293312"/>
<total type="rest" count="22498068" size="1597097332"/>
<system type="current" size="17265770496"/>
<system type="max" size="17271173120"/>
<aspace type="total" size="491339776"/>
<aspace type="mprotect" size="496742400"/>
</malloc>
这一切究竟意味着什么?
我会在答案中加入一些我自己的笔记/想法,但如果有人比我了解更多,我将不胜感激。
ldd --version 报告 Ubuntu EGLIBC 2.19-0ubuntu6.13,这是我对 glibc 版本的最佳猜测。
【问题讨论】:
标签: eglibc glibc malloc glibc eglibc