Linux 内存管理:机制、操作与优化策略
1. 内存统计信息获取
在 Linux 中, mallinfo() 函数可用于获取内存分配的统计信息,其返回一个 mallinfo 结构体,该结构体定义于 <malloc.h> 中,具体内容如下:
/* all sizes in bytes */
struct mallinfo {
int arena; /* size of data segment used by malloc */
int ordblks; /* number of free chunks */
int smblks; /* number of fast bins */
int hblks; /* number of anonymous mappings */
int hblkhd; /* size of anonymous mappings */
int usmblks; /* maximum total allocated size */
int fsmblks; /* size of available fast bins */
int uordblks; /* size of total allocated space */
int fordblks; /* size of available chunks */
int keepcost; /* size of trimmable space */
};
超级会员免费看
订阅专栏 解锁全文

被折叠的 条评论
为什么被折叠?



