我如何弄清楚匿名内存是用来做什么的? [英] How can I figure out what anonymous memory is being used for?

查看:157
本文介绍了我如何弄清楚匿名内存是用来做什么的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个程序不会耗尽,但匿名/本地内存的使用却在增长.我该如何找出正在使用此内存的内容?

I have a program which is not running out of heap but for which the use of anonymous/native memory grows and grows. How can I go about figuring out what is using this memory?

推荐答案

检查堆转储中是否包含DirectByteBuffer对象以及保留了哪些对象.文件映射也是一个原因,但您说的是匿名映射,因此这里可能不是问题,因为将对其进行命名.

Inspect a heap dump for DirectByteBuffer objects and what's holding onto them. File mappings would also be a cause, but you say anonymous mappings so that's probably not the issue here since those would be named.

对于某些事情本地内存跟踪可能也有用.

For some things native memory tracking may be useful too.

如果既不是DirectByteBuffer实例也不是VM管理的其他内存池,则可能是您的应用程序使用的某些本机库.

If it's neither DirectByteBuffer instances nor other memory pools managed by the VM it might be some native library used by your application.

这篇关于我如何弄清楚匿名内存是用来做什么的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆