在Linux上区分Java应用程序映射的内存和JVM映射的内存 [英] Differentiate between Java application mmaped memory and JVM mmapped memory on Linux

查看:134
本文介绍了在Linux上区分Java应用程序映射的内存和JVM映射的内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

考虑到在Linux上运行的Java应用程序,我想通过Java 应用程序测量映射内存的量,并通过JVM本身来测量映射内存的量.

Considering a Java application running on Linux, I want to measure the amount of mmapped memory by Java application and amount of mmapped memory by JVM itself.

问题1: 我可以使用/proc/{pid}/map来跟踪应用程序的mmap调用.此输出有什么方法可以帮助我测量此差分内存映射?如果没有,还有其他工具可以帮助我吗?

Question 1: I can use /proc/{pid}/map to track mmap calls by an application. Is there any way this output can help me to measure this differential memory map? If not, is there any other tool that can help me?

问题2: 如果Java 应用程序 (不是JVM)打开一个大文件,它也会被映射吗?如果可以,我可以在Java流程图中区分和测量此映射区域的大小吗?

Question 2: If Java application (not JVM) opens a large file, does it get mmapped as well? If yes, can I differentiate and measure size of this mmapped region within Java process map?

推荐答案

a>报告支持字节缓冲区的映射.其他JVM内部的映射可以通过 NMT跟踪

The BufferPoolMXBean which can also be accessed via visualvm reports the mappings which are backing bytebuffers. Other JVM-internal mappings can be tracked via NMT

这篇关于在Linux上区分Java应用程序映射的内存和JVM映射的内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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