Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hyj1991 opened this issue Jan 2, 2024 · 2 comments
Open

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

hyj1991 opened this issue Jan 2, 2024 · 2 comments
Assignees
Labels

Comments

@hyj1991
Copy link
Member

hyj1991 commented Jan 2, 2024

// 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
Copy link
Member Author

hyj1991 commented Jan 2, 2024

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

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

  • external 低但是 arena 高
    • ordblks 高,基本上就是 top chunk 一直 inuse 导致的问题
    • ordblks 低,基本上可以判断使用了 addon,且不走 v8 binding

@hyj1991 hyj1991 added the feature label Jan 2, 2024
@hyj1991
Copy link
Member Author

hyj1991 commented Jan 2, 2024

预计的改动:

  • xprofiler
  • console
  • manager
    • process table
    • alarm

@hyj1991 hyj1991 self-assigned this Jan 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant