X-Profiler / xprofiler

🌀An addon for node.js, which supporting output performance log and real-time profiling through sampling.
Other
422 stars 57 forks source link

[RFC] 内存视图增加 glibc 信息 #241

Open hyj1991 opened 8 months ago

hyj1991 commented 8 months ago
// malloc/malloc.h
struct mallinfo
{
  int arena;    /* non-mmapped space allocated from system */
  int ordblks;  /* number of free chunks */
  int smblks;   /* number of fastbin blocks */
  int hblks;    /* number of mmapped regions */
  int hblkhd;   /* space in mmapped regions */
  int usmblks;  /* always 0, preserved for backwards compatibility */
  int fsmblks;  /* space available in freed fastbin blocks */
  int uordblks; /* total allocated space */
  int fordblks; /* total free space */
  int keepcost; /* top-most, releasable (via malloc_trim) space */
};
hyj1991 commented 8 months ago

Optional:不使用 glibc malloc 的话没有这部分数据

可以用来快速判断 rss 高但是 heap 低的原因:

hyj1991 commented 8 months ago

预计的改动: