diff options
author | 2022-11-28 19:18:17 -0800 | |
---|---|---|
committer | 2022-11-28 19:18:17 -0800 | |
commit | da4376103205bc9bdb810fee5cc8d343d04f36ef (patch) | |
tree | 1b9e640fab5fcc3d48fb0893df8fa0587a2fbbb0 | |
parent | 4efce63dadb596eeb08b7c72a0f8d1fdec54e1e1 (diff) | |
download | bun-da4376103205bc9bdb810fee5cc8d343d04f36ef.tar.gz bun-da4376103205bc9bdb810fee5cc8d343d04f36ef.tar.zst bun-da4376103205bc9bdb810fee5cc8d343d04f36ef.zip |
Update README.md
-rw-r--r-- | README.md | 27 |
1 files changed, 26 insertions, 1 deletions
@@ -4812,7 +4812,32 @@ To view the snapshot, open the `heap.json` file in Safari's Developer Tools (or #### Native heap stats -Bun uses mimalloc for the other heap. To report a summary of non-JavaScript memory usage, set the `MIMALLOC_SHOW_STATS=1` environment variable. +Bun uses mimalloc for the other heap. To report a summary of non-JavaScript memory usage, set the `MIMALLOC_SHOW_STATS=1` environment variable. and stats will print on exit. + +```js +MIMALLOC_SHOW_STATS=1 bun script.js + +# will show something like this: +heap stats: peak total freed current unit count + reserved: 64.0 MiB 64.0 MiB 0 64.0 MiB not all freed! + committed: 64.0 MiB 64.0 MiB 0 64.0 MiB not all freed! + reset: 0 0 0 0 ok + touched: 128.5 KiB 128.5 KiB 5.4 MiB -5.3 MiB ok + segments: 1 1 0 1 not all freed! +-abandoned: 0 0 0 0 ok + -cached: 0 0 0 0 ok + pages: 0 0 53 -53 ok +-abandoned: 0 0 0 0 ok + -extended: 0 + -noretire: 0 + mmaps: 0 + commits: 0 + threads: 0 0 0 0 ok + searches: 0.0 avg +numa nodes: 1 + elapsed: 0.068 s + process: user: 0.061 s, system: 0.014 s, faults: 0, rss: 57.4 MiB, commit: 64.0 MiB +``` ## Credits |