Demo?https://www.youtube.com/watch?v=X5iPhGIswlI
1. Introduction
JProfiler is a Java profiler combining CPU, Memory and Thread profiling in one application. It is developed by ej-technologies and currently in version 10.1.
...
- Live profiling of a local session
- Live profiling of a remote session
Offline Profiling
Snapshot Comparisons
Benefits?
Exceptional ease of use
Real-time display of profiling data
The unique heap walker
The powerful CPU, Thread, Memory profiler
Low overhead
Broadest support for platforms, IDEs and application servers
2. Data Collection Architecture
Users give instruction for monitoring in the JProfiler GUI.
JProfiler GUI sends instructions to the JProfiler Agent in the analyzed JVM through the socket(default port 8849).
After the JProfiler Agent receives the instruction, it converts the instruction to an event or instruction that needs to be monitored, to register on JVMTI.
JVMTI collects information about the current JVM based on registered events.
For example: the life cycle of a thread;The lifecycle of the JVM;The life cycle of classes;The life cycle of an object instance;Real-time information on heap memory, and so on.
The JProfiler Agent saves the collected information to memory in a certain rule.
Return to JProfiler GUI with Socket.
JProfiler GUI Socket returns the information received to the JProfiler GUI Render.
JProfiler GUI Render present the final display effect.
3. Important concept of JProfiler
3.1 start up mode
- Attach mode: JProfiler agent can be loaded directly into a running JVM.
- Profile at startup: the first option in the picture below
- Prepare for profiling: the second option in the picture
- Offline profiling: the third option in the picture
3.2 Session settings:
A. Filter?class or packages
B. Profiling Settings:
C. Triggers: usually use in offline mode, tell JProfiler Agent when to trigger what behavior to collect the specified information.
3.3 Profiling views
Here’s what the JProfiler’s GUI looks like:
...
E. Threads: This module is mainly used to monitor the running state of the management thread.
An example of installation and configuration
Website? https://www.ej-technologies.com/products/jprofiler/overview.html
1. Download the corresponding version (for example: JProfiler 9.2)
For Windows:
1) download installation package: jprofiler_windows-x64_9_2.exe
...
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$JPROFILER_HOME
2. Example: Create a project to monitor remote Tomcat (Profile at startup :wait for a connection from Jprofiler GUI)
1) Double click Jprofiler?start to run it.
...
11) Start the JProfiler monitoring.
JProfiler IDE Integrations
- IntelliJ IDEA
- Eclipse IDE
- Jdeveloper
- NetBeans
...