
seen from United States
seen from Hong Kong SAR China
seen from South Korea
seen from Netherlands
seen from Türkiye
seen from China

seen from United States
seen from United Kingdom
seen from Netherlands

seen from United States

seen from United States
seen from Pakistan

seen from Netherlands

seen from Malaysia

seen from Türkiye
seen from United States
seen from China

seen from United Kingdom

seen from United States
seen from Australia
Memory Analysis - How to obtain Java Heap Dump?
Memory Analysis – How to obtain Java Heap Dump?
In this article we will see how to obtain the Java Heap Dump to troubleshoot the memory issues like memory leak and high usage of memory. There are different options available to obtain the Heap Dump. The options will vary based on the JVM vendors. In this article I used Oracle JDK8.
Automatically generate the Heap Dump when application throws “OutOfMemoryError”
In this approach, we have to pass…
View On WordPress
Java Profiling
A nice tool for getting started on Java profiling is jvisualvm which ships with the standard SDK.
Through this you can monitor processes running on the local machine very easily and remote processes with some more configuration.
It can be launched from the command line with the command 'jvisualvm'
This is what you will see when you launch, choose the process you want to probe.
Let's say we choose the ExplodeExtractConvert Process.
The "Overview" tab tells you basic details about the process including the JVM parameters and System properties which are good as a quick reference and (sometimes) sanity checks.
The "Monitor" tab can help you identify bottlenecks e.g.
CPU usage is constantly very high
Memory constantly climbing and not being released after GC to come to a base level
Number of threads constantly growing or not being idle even when the application is at rest (like in a web server with no load)
Look at the live threads. Here I have just the main thread as the relevant one. On web server processes you will see a number of threads and looking at their behavior can tell you whether you need to increase/decrease the number.
It is instructive to filter the methods by your methods in your custom code and look at the methods that take up the most CPU. You may see a methods taking up a lot of time which you did not expect. Fix it :)
Memory Profiling. Again, filtering by custom classes can sometimes be useful. Its normal to have lots of primitives and strings here. If you are looking for a memory leak here - you usually find a clue for it in the first few classes which are not strings or primitives
Here's the sampler output for memory.
MEMO-How to monitor remote JBoss AS?
前置條件:
請參考這篇
步驟:
1. 首先對在遠端主機上的JBOSS AS修改執行組態檔$JBOSS_HOME/bin/run.conf.bat增加底下幾組參數
set "JAVA_OPTS=%JAVA_OPTS% -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.port=6789"
set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.ssl=false"
set "JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote.authenticate=false"
set "JAVA_OPTS=%JAVA_OPTS% -Djava.rmi.server.hostname=10.10.0.182"
2. 再來在遠端主機上執行底下jstatd指令
jstatd -p 1099 -J-Djava.security.policy=d:/javatools/tools.policy
3. 再來執行JBoss AS
run -b 10.10.0.182 -c default
3. 最後,就可以在本地端執行jvisualvm來監控遠端的JBoss主機
在Remote分類上,按滑鼠右鍵「Add Remote Host...」指定Host name=10.10.0.182
然後在10.10.0.182項目上按滑鼠右鍵「Add JMX Connection...」指定Connection=10.10.0.182:6789
附註:
1. jvisualvm可加掛VisualVM-JConsole & VisualVM-MBean這兩個Plugins 2. 從jvisualvm命令列:Tools→Options→JConsole Plugins來新增JTop.jar,壓按「Add JAR/Folder」按鈕,指定$JAVA_HOME/demo/management/JTop/JTop.jar檔案即可
相關jvisualvm監控遠端JBoss AS 5.1.0 GA之畫面截圖:
https://www.facebook.com/photo.php?fbid=10150260428371340&set=a.86528566339.103237.639486339&type=1&theater https://www.facebook.com/photo.php?fbid=10150260428586340&set=a.86528566339.103237.639486339&type=1&theater https://www.facebook.com/photo.php?fbid=10150260428736340&set=a.86528566339.103237.639486339&type=1&theater https://www.facebook.com/photo.php?fbid=10150260428911340&set=a.86528566339.103237.639486339&type=1&theater
參考資源:
http://hillert.blogspot.com/2010/01/remote-profiling-of-jboss-using.html http://visualvm.java.net/jconsole_plugin_wrapper_tab.html