如何在 Eclipse 内存分析器工具中将 @retainedHeapSize 与 oql 相加
您使用过 Eclipse 中的 MAT(内存分析器工具)吗? 真的很酷。(1.5G堆转储文件kill jhat,ibm的带有OOME的堆转储分析器)。 MAT 充满活力、快速、美丽且强大。
我想知道ehcahce key的内存大小是多少,所以在下面写oql。
SELECT c.key.@retainedHeapSize
FROM net.sf.ehcache.store.compound.HashEntry c
不幸的是,像 sum()、max()、min() 这样的分组函数不存在。 我将总结果行(大约 60,000)导出到 Excel 文件并在 Excel 工作表中求和。
您有关于使用组函数(如 sum())的提示或隐藏(?)函数/功能吗?
Have you used MAT(Memory Analyzer Tool) from eclipse.
it's really cool.(1.5G heap dump file kill jhat, ibm's heap dump analyzer with OOME).
MAT is alive and fast and beautiful and powerful.
I wonder how much the ehcahce key's memory size is, so write oql below.
SELECT c.key.@retainedHeapSize
FROM net.sf.ehcache.store.compound.HashEntry c
Unfortunately, the group function like sum(), max(), min() does't exist.
I export total result row(about 60,000) to excel file and sum in the excel sheet.
Do you have the tip or hidden(?) function/feature about using group function(like sum())?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以从 OQL 结果生成直方图 - 选择“显示为直方图”图标。
从该直方图中,您可以使用“计算精确保留集”图标计算保留大小。
You can generate a Histogram from the OQL results - select the "Show as Histogram" icon.
From this histogram you can calculate the retained size using the "Calculate Precise Retained Set" icon.
据我从内存分析器文档中可以看出,它的 OQL 中没有聚合函数。
但是,在 VisualVm 中(从 1.6 开始就包含在 JDK 中)和 可作为独立应用程序下载)您可以这样做:
或者,如果您想要浅层大小而不是保留大小 - 将“rsizeof”更改为“sizeof” :
As far as I can tell from the Memory Analyzer documentation there are no aggregation functions in it's OQL.
However, in VisualVm (included with the JDK since 1.6 and downloadable as a standalone application) you can do it like this:
or, if you want the shallow size instead of the retained size - change the "rsizeof" to "sizeof":
似乎在 MAT 或 OQL 中没有办法做到这一点,
但是您可以通过其他方式做到这一点。
执行查询后,您可以将结果导出到 cvs 文件。然后你可以通过excel sum工具得到结果。
It is seems that there is no way to do it in the MAT or by the OQL
However you can do it by the other way.
after you execute your query, you can export the result to a cvs file. then you can get the result by the excel sum tool.
如果您更喜欢 MAT 而不是 Visual VM 并且不坚持 OQL,您也可以使用它的方解石插件 (https: //github.com/vlsi/mat-calcite-plugin)。
总和的一个示例是:
您可以在此处将其功能与 oql 进行比较: https://wiki.eclipse.org/MemoryAnalyzer/OQL#OQL_.28Memory_Analyzer.29_versus_SQL_.28MAT.2FCalcite.29
If you prefer MAT to Visual VM and not insist on OQL you can also use it's calcite plugin (https://github.com/vlsi/mat-calcite-plugin).
An example for the sum is:
You can compare it's capabilities with oql here: https://wiki.eclipse.org/MemoryAnalyzer/OQL#OQL_.28Memory_Analyzer.29_versus_SQL_.28MAT.2FCalcite.29