Profiling your application (Yourkit)
Install Yourkit
Linux
./yjp.sh
Windows
yjp-12.0.5.exe
Profile your application by Yourkit
Plugin IDE
Manual config
-agentpath:<profiler directory>\bin\win64(win32)\yjpagent.dll
-agentpath:<profiler directory>/bin/linux-x86-64(linux-x86-32)/libyjpagent.so
default port:10001
-agentpath:<profiler directory>\bin\win64(win32)\yjpagent.dll=port=1090
more options: http://www.yourkit.com/docs/java/help/startup_options.jsp
Attach in runtime
a. Attach for local connect purpose
b. Attach for remote connet purpose
(1) The attach mode is only supported for Sun Java (HotSpot) and JRockit
(2) Attach may fail due to insufficient access rights
(3) Requires kernel 2.6
...
not suggestion using attach mode
Before profiling
JVM memory structure
Shallow size/Retained size
Shallow heap is the memory consumed by one object. An object needs 32 or 64 bits (depending on the OS architecture) per reference, 4 bytes per Integer, 8 bytes per Long, etc. Depending on the heap dump format the size may be adjusted (e.g. aligned to 8, etc...) to model better the real consumption of the VM.
Retained set of X is the set of objects which would be removed by GC when X is garbage collected.
Retained heap of X is the sum of shallow sizes of all objects in the retained set of X, i.e. memory kept alive by X.
Generally speaking, shallow heap of an object is its size in the heap and retained size of the same object is the amount of heap memory that will be freed when the object is garbage collected.
GC root
A garbage collection root is an object that is accessible from outside the heap. The following reasons make an object a GC root:
System Class
Class loaded by bootstrap/system class loader. For example, everything from the rt.jar like java.util.* .
JNI Local
Local variable in native code, such as user defined JNI code or JVM internal code.
JNI Global
Global variable in native code, such as user defined JNI code or JVM internal code.
Thread Block
Object referred to from a currently active thread block.
Thread
A started, but not stopped, thread.
Busy Monitor
Everything that has called wait() or notify() or that is synchronized. For example, by calling synchronized(Object) or by entering a synchronized method. Static method means class, non-static method means object.
Java Local
Local variable. For example, input parameters or locally created objects of methods that are still in the stack of a thread.
Native Stack
In or out parameters in native code, such as user defined JNI code or JVM internal code. This is often the case as many methods have native parts and the objects handled as method parameters become GC roots. For example, parameters used for file/network I/O methods or reflection.
Finalizer
An object which is in a queue awaiting its finalizer to be run.
Unfinalized
An object which has a finalize method, but has not been finalized and is not yet on the finalizer queue.
Unreachable
An object which is unreachable from any other root, but has been marked as a root by MAT to retain objects which otherwise would not be included in the analysis.
Unknown
An object of unknown root type. Some dumps, such as IBM Portable Heap Dump files, do not have root information. For these dumps the MAT parser marks objects which are have no inbound references or are unreachable from any other root as roots of this type. This ensures that MAT retains all the objects in the dump.
CPU time/Work time
CPU time is the time on scheduler
Work time is the total time from request in to response out
Thread status
NEW: The thread is created but has not been processed yet.
RUNNABLE: The thread is occupying the CPU and processing a task. (It may be in WAITING status due to the OS's resource distribution.)
BLOCKED: The thread is waiting for a different thread to release its lock in order to get the monitor lock.
WAITING: The thread is waiting by using a wait, join or park method.
TIMED_WAITING: The thread is waiting by using a sleep, wait, join or park method. (The difference from WAITING is that the maximum waiting time is specified by the method parameter, and WAITING can be relieved by time as well as external changes.)
5 CPU profile
# Telemetry
# Sampling
# Tracking
To begin obtaining profiling results, start CPU measuring when your application requires it.
You can choose either of two available measurement modes: sampling or tracing.
Sampling
|
Tracing
|
|
Measured time accuracy
|
High for long running methods, low for short running methods
|
Low to high, depending on profiled application and settings
|
Invocation counts
|
Not available
|
Available
|
Overhead
|
Negligible unless J2EE high-level profiling is enabled in the settings
|
Low to high, depending on profiled application and settings
|
# Filter methods
6 Thread monitor
# Telemetry
# Monitor profile
7 Memory profile
# Telemetry
The "Memory" tab shows live memory usage statistics:
The bottom table on "Memory" tab provides a class instance count statistics - a quick overview of current heap state:
# Record by thread/method/classloader/GC root (allocation)
# Compare two snapshot
# Object generations
# Support of HPROF format snapshots
8 Exception profile
# Show where the exception throws
Conclusion
# Out of memory occurd
# Memory leak
# Timeout
# Deadlock
# Also anytime when you want to refine your application
相关推荐
yourkit v11版本使用说明: 1.用winrar打开lib目录下的yjp.jar 2.进入目录yjp.jar\com\yourkit\f 3.将k.class替换到同名文件 yourkit v12版本使用说明: 1.用winrar打开lib目录下的yjp.jar 2.进入目录yjp.jar\...
yourkit v12.05版本使用说明: 1.用winrar打开lib目录下的yjp.jar 2.进入目录yjp.jar\com\yourkit\g 3.将k.class替换到同名文件 使用下面命令生成注册码: java -jar yourkit_keygen_v1205.jar 根据提示输入注册...
YourKit 9.5.2安装包 YourKit 9.5.2安装包
yourkit9.5绿色版本 可以使用的!
yourkit的使用技术
YourKit 11.0
最新YourKit Java Profiler 2019.01 最新破解版 build 111 绿色安装。 欢迎大家试用。 免责声明:这只是供个人开发爱好者使用,如用于商业或公司目的,请购买正版,否则由此产生的后果,本人概不负责。 毕竟这只是...
yourkit 2020.9-b416
yourkit-11、12破解文件,可以完美破解yourkit,yourkit_11,12keygen破解文件
YourKit jProfiler eclipse3.5插件
YourKit Java Profiler 2017 破解版YourKit Java Profiler 2017 破解版YourKit Java Profiler 2017 破解版YourKit Java Profiler 2017 破解版
最新YourKit Java Profiler 2015破解版 build 15050 绿色安全 YourKit Java Profiler是目前最好的一款Java Profiler软件
YourKit---JAVA性能监控工具
YourKit Java Profiler 是业界领先的Java剖析工具。CPU和内存的剖析历来是很困难的,YourKit创造出了革命性的剖析工具,应用在研发和生产阶段,为专业的Java开发者带来了无比的好处。 YourKit Java Profiler keygen...
YourKit Java Profiler 2017 破解版本,仅供学习交流,如需商用,请到官方网站下载正版软件
The latest stable version: YourKit Java Profiler 2020.09 build 410
yourkit java profiler 2015 注册码 实测可进行正常安装 服务器进程内存分析不可多得的工具
YourKit是我在另一个项目中偶然发现的一款性能分析工具,它的安装很简单。安装时有一个选项,可以安装一个插件到我的IDE。安装后,运行应用程序,使用该插件,它会自动连接到YourKit。它有一个漂亮的用户界面可以...
YourKit Java Profiler,注册机,破解: 使用方法: 用bat打开注册机,先点击patch按钮打补丁,选择yourkit安装目录下的/lib/yjp.jar然后确定,打补丁后生成注册码就可以了