gpt4 book ai didi

java - JMH中的分配率是什么意思

转载 作者:搜寻专家 更新时间:2023-11-01 03:31:57 26 4
gpt4 key购买 nike

我正在尝试测量运行基准测试时消耗的内存。我在互联网上发现我可以使用 GC 分析器来测量它。我试过了,但我不明白答案,也看不到消耗的内存量。任何人都可以解释结果吗?谢谢。

MyBenchmark.testMethod_width_2_attribute_text                                     ss   60        32.345 ±       1.759   ms/op
MyBenchmark.testMethod_width_2_attribute_text:·gc.alloc.rate ss 60 26.904 ± 0.217 MB/sec
MyBenchmark.testMethod_width_2_attribute_text:·gc.alloc.rate.norm ss 60 14999630.400 ± 12.578 B/op
MyBenchmark.testMethod_width_2_attribute_text:·gc.churn.PS_Eden_Space ss 60 28.282 ± 15.342 MB/sec
MyBenchmark.testMethod_width_2_attribute_text:·gc.churn.PS_Eden_Space.norm ss 60 15903402.667 ± 8631257.013 B/op
MyBenchmark.testMethod_width_2_attribute_text:·gc.churn.PS_Survivor_Space ss 60 0.654 ± 0.754 MB/sec
MyBenchmark.testMethod_width_2_attribute_text:·gc.churn.PS_Survivor_Space.norm ss 60 368914.667 ± 425374.152 B/op
MyBenchmark.testMethod_width_2_attribute_text:·gc.count ss 60 26.000 counts
MyBenchmark.testMethod_width_2_attribute_text:·gc.time ss 60 105.000 ms

最佳答案

在幕后,jmh 使用 ThreadMXBean 所以这看起来像是一份报告,说明每个操作分配了多少字节以及每个 GC 空间中有多少 MB/sec(例如伊甸园/幸存者)

.norm 代表归一化。

关于java - JMH中的分配率是什么意思,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49037136/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com