VisualVM

How can you run profiling on a Java application wrapped as an .exe?

喜你入骨 提交于 2019-12-08 12:58:02
问题 I would like to run profiling using jstatd and visualvm against a third-party Java application which has been wrapped as an .exe . Does anybody have advice on how this can be achieved? 回答1: You don't need anything special. Just run VisualVM locally under the same user as your Java application. It does not matter that it is wrapped as .exe file. What version of JDK does you application use? 来源: https://stackoverflow.com/questions/15789908/how-can-you-run-profiling-on-a-java-application-wrapped

Limiting Profiling in Visual VM

﹥>﹥吖頭↗ 提交于 2019-12-07 15:08:55
问题 I am trying out the VisualVM program that comes with the new JDKs. I am doing profiling on it and trying to profile CPU on only methods in a particular package. I put the following in the "Profile Only Classes:" jig.* Where jig is the package I want to instrument. Unfortunately I get back results on other methods that are not in that package or any subpackages. 回答1: The only way I can reproduce your problem is if I leave the "Profile new Runnables" box checked. When I leave that checked, the

learning sites for fixing java memory leaks

笑着哭i 提交于 2019-12-07 14:49:50
问题 What would be the best places to learn fixing a java memory leak ? I have been trying to find good resource over the NET but to my disappointment, I find toy examples being discussed. I am also able to troubleshoot small toy dumps but the real world application dumps are more challenging and give little clue. I have tried tools like Jhat, JMap, VisualVM and MAT. what would be the best place to learn about fixing Java memory leaks ? suggestion of a book is also welcome. thanks in advance. 回答1:

一文详解java中对JVM的深度解析、调优工具、垃圾回收

一曲冷凌霜 提交于 2019-12-07 08:35:37
jvm监控分析工具一般分为两类,一种是jdk自带的工具,一种是第三方的分析工具。jdk自带工具一般在jdk bin目录下面,以exe的形式直接点击就可以使用,其中包含分析工具已经很强大,几乎涉及了方方面面,但是我们最常使用的只有两款:jconsole.exe和jvisualvm.exe;第三方的分析工具有很多,各自的侧重点不同,比较有代表性的:MAT(Memory Analyzer Tool)、GChisto等。 jconsole Jconsole(Java Monitoring and Management Console)是从java5开始,在JDK中自带的java监控和管理控制台,用于对JVM中内存,线程和类等的监控,是一个基于JMX(java management extensions)的GUI性能监测工具。jconsole使用jvm的扩展机制获取并展示虚拟机中运行的应用程序的性能和资源消耗等信息。 直接在jdk/bin目录下点击jconsole.exe即可启动,界面如下: 在弹出的框中可以选择本机的监控本机的java应用,也可以选择远程的java服务来监控,如果监控远程服务需要在tomcat启动脚本中添加如下代码: -Dcom.sun.management.jmxremote.port=6969 -Dcom.sun.management.jmxremote.ssl

Understanding CPU time in visualvm profiler

白昼怎懂夜的黑 提交于 2019-12-07 05:26:25
问题 I have started to use visualvm for profiling my application which I launch in Eclipse. Then I launch visualvm which initially gives believable results. After some time two processes appear in the monitor which consume huge amounts of time. I have not deliberately invoked these. After a time they disappear. Are they an artefact of the profiling process and do I need to worry? Very few of my routines appear in the profile, mainly the libraries they call. Is there a way of showing which routines

VisualVM is unable to profile a web application on Eclipse

风格不统一 提交于 2019-12-07 02:13:17
问题 I would like to profile my Spring Web Application that is running on Tomcat and Eclipse. I added VisualVM to the Eclipse and followed below steps to run the application for profiling. Right click on the application name > Run As > Run Configuration > Java Application > 'Selected Project' > Set 'org.apache.catalina.starup.Boostrap' as a value for Main class, also selected VisualVM as the Launcher > clicked on Run button. The VisualVM starts but shows following message: "Cannot open requested

VisualVm使用JMX的方式连接远程JVM

ⅰ亾dé卋堺 提交于 2019-12-07 01:43:35
1、在catalina.sh中添加配置如下: 在其中“# ----- Execute The Requested Command -------------”之前插入一行(中间没有换行): CATALINA_OPTS="$CATALINA_OPTS -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=8999 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Djava.rmi.server.hostname=机器IP" 特别注意:-Djava.rmi.server.hostname=机器IP这一行需要加上,不然可能本机能连上,远程连不上。很多帖子中的介绍配置没有这一行。 2、lsof -i:8999查看端口状态: 3、使用visualVm监控远程虚拟机:相对于使用jstatd的监控,使用jmx的方式会有更多的可以监控的功能,如Threads等。 4、为了安全起见,可以采用配置鉴权的方式,详见参考文献中的介绍。本文不再赘述 参考文献:https://blog.csdn.net/liuxigiant/article/details/40344699 http:/

VisualVM OQL: how to search for primitive float values rather than actual Float instances?

爱⌒轻易说出口 提交于 2019-12-06 12:04:23
I am wondering how one can search for all primitive float values that match a certain number. When doing something like: select n from java.lang.Float n where n.value == 1.00 Only the Float class instances are being found. The application I am exploring is using different wrappers than just Float (eg. Vectors) that use primitive float values as fields for which I need to search. How would I accomplish this? The following returns a "float is not found error": select n from float n where n.value == 1.00 A primitive value exists only as a field in the structure it's a part of (or directly on the

VisualVM stack variable values when doing a thread dump

穿精又带淫゛_ 提交于 2019-12-06 09:57:28
问题 Is it possible to obtain a view of the values of the stack variables when doing a thread dump in VisualVM? Currently, all that I can see when choosing a thread dump of some jvm process is the stack trace, not the exact variable values in stack frames. If not, is there a (working) plugin that allows one to do this? Thanks! 回答1: VisualVM 1.3+ shows local variables in the thread dump. 来源: https://stackoverflow.com/questions/4097755/visualvm-stack-variable-values-when-doing-a-thread-dump

heapdump size vs hprof size

こ雲淡風輕ζ 提交于 2019-12-06 07:00:08
I recently made a heapdump in a hprof format when my jboss server was running with a xms of 4096m and xmx of 4096m and a permsize of 512m. The hprof file generated is over 5gb. When I load the heapdump in visualvm, mat analyzer or yourkit, I only see a total bytes of approximately 1gb. I've tried changed the reachability scope in yourkit but it does not show more than 1 gb. Any idea what this big difference in filesize vs displayed heapdump size can cause? ps: I'm using jdk1.6.0_23 Unfortunately I'm not allowed to submit screenshots here. On the filesystem the hprof size is of 5.227.659 kb and