什么是堆配置文件中的微量元素?

What are Trace Elements in Heap Profile?

在使用 -hd 标志分析我的 Haskell 程序时,我看到大约 50K 列为“跟踪元素”。这是什么意思?

这些是堆图中的额外条带,它们太小而无法显示,也就是说,每个条带仅对堆大小贡献“微量”,例如 trace chemical elements. You can adjust the threshold with the -t flag, documented in the GHC User’s Guide §8.5. hp2ps – Rendering heap profiles to PostScript:

-t⟨float⟩

Normally trace elements which sum to a total of less than 1% of the profile are removed from the profile. The -t option allows this percentage to be modified (maximum 5%).

-t0 requests no trace elements to be removed from the profile, ensuring that all the data will be displayed.