如何在代码中配置JVM内存? [英] How to Profile JVM memory in the code?

查看:212
本文介绍了如何在代码中配置JVM内存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个我无法在Eclipse中测试的servlet,我需要在服务器上运行。我想做内存分析并找出任何泄漏点。所以,我想我需要编写调试语句来告诉我当前的内存使用情况。有人能指点我如何做这个和/或JDK中的哪些类做这个好的参考?

I am writing a servlet that I can't test in Eclipse, I need to run on server. I want to do memory profiling and pinpoint any leaks. So, I think I need write debug statements that can tell me current memory usage. Can someone point me to good references on how to do this and/or which classes in the JDK do this ?

注意我不能使用Eclipse MAT 。

Note that I can't use the "Eclipse MAT".

推荐答案

你不能在jdk中使用内置工具 jvisualvm

Can't you use the built-in tool in the jdk jvisualvm?

这篇关于如何在代码中配置JVM内存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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