kaiyuanshe / kaiyuanshe.github.io

The Official Web site of KaiYuanShe
https://kaiyuanshe.cn/
25 stars 13 forks source link

set libjemalloc gc config #293

Closed luojiyin1987 closed 8 months ago

luojiyin1987 commented 8 months ago

Is there an existing feature request for this?

Description

ENV MALLOC_CONF=dirty_decay_ms:1000,narenas:2,background_thread:true

设置 1000ms 运行一次 GC。 2个 narenas 进行内存分配,默认值是1 , 这样可以加快内存分配速度, 可以根据需求配置为 4, 8 等,值越大分配速度越快,也更消耗内存。
后台进程进行内存回收,加快内存回收速度,会多消耗 CPU资源, 默认是关闭的。

参考资料

Use Case

No response

Proposed Solution

No response