Integrated into Eclipse,
(Close eclipse before performing the consolidation)
Main Menu –> session–>ide intergrations–> Select Eclipse (a version)
Perform "Integrate" and select the folder where eclipse resides. such as: D:\Java\eclipse
4 Start Eclipse in D:\eclipse\eclipse.exe–clean (the purpose is to clear the plug-in cache, only the first time you add this parameter)
5. Configure Jprofiler in Eclipse.
Main Menu –>window–>customize perspective–>commands–> find profile,
Select it, and then click OK.
2 Configuring Tomcat projects and enabling monitoring
Let's say you have a project on hand to publish on a Tomcat server, for example, the author on hand the project name is the DSPMSU_FOR_DISPLAY,TOMCAT server is a 7.x version, the following we explain how to monitor the local TOMCAT7 server, the details are as follows:
Click Session→integration wizards→new Server integration→apache Tomcat 7.x→on This computer→ tick your JVM information →waif for a connection F Rom the Jprofiler GUI (which is jprofiler to help you start tomcat) → Select your startup.bat→ to keep the default port 8849→ boot.
Tips
1. You save this session in Jprofiler, if you double-click to run it, Its essence is to invoke Startup.bat to start, so if you have manually enabled Tomcat and then start the session in Jprofiler, this will be an error-the port is occupied;
2. In the monitoring process, if Tomcat accidentally closes, this time will report the following such a mistake, error prompts you to tick "Keep VM alive", in Start center edit your saved session→profiling The Settings tab →customize Profiling settings→miscellaneous→keep VM alive.
3. How to monitor performance
3.1 Intuitive Understanding
Such a powerful tool, how to monitor performance. This topic is too big, we narrow the scope, how to get started. Accidentally found a blogger on the CSDN blog, inside the "actual combat" example can definitely let you have a visual understanding of performance monitoring.
Please take a few minutes to look at this blog post: Jprofiler Learning Notes
A few minutes soon passed, let's make the following summary:
1. Right-click the related class in the memory views view to select Mark current values to mark the present value for subsequent comparisons, noting the green and red points;
After marking, it is easy to see the change of value through GUI interface
2. Press F4 or click on the green icon on the form the run GC can notify the JVM of the Action of garbage collection (only notifications, not forced collections);
3. Right-click the related class in the Memory Views view, click Show Selection in Heap Walker can do heap memory tracking;
4. In Heap Walker view, right-click the related class and click used Selected instances→allocation tree to see the call details and memory usage for that class.
Allocation tree is looking at call trees, and you can also choose other options as needed.
3.2 Module Introduction
The introduction of the module is mainly to jprofiler the specific functions of the introduction, some of the reference from the blog: Jprofiler to solve the performance of Java server tracking, if the reader's ability to read English more than a strong can also click Help in the toolbar, directly read English helps, The following sections are also referenced from the English API.
3.2.1 Memory View Memory views
The Jprofiler Memory View section provides dynamic memory usage update views and a view that displays information about memory allocation status. All views have several clustered layers and are capable of displaying existing objects and objects that are garbage collected.
All objects All Objects
Displays the package for all objects in the class or on the status statistics and size information heap. You can mark the current value and display the difference value. Recording Object Record Objects
Displays the package for the class or all the logged objects. You can mark the current value and display the difference value. Assign Access tree allocation
Displays a request tree or a method, class, package, or a Java EE component with annotated allocation information for the selected class. Distribution hotspot allocation hot spots
Displays a list that includes methods, classes, packages, or Java EE components that assign selected classes. You can mark the current value and display the difference value. For each hotspot, it can display its track record tree. Category Tracker Class Tracker
Class trace views can contain any number of charts that show instances and times of the selected class and package.
3.2.2 Heap Traversal Heap Walker
In the Jprofiler heap traversal (Heap Walker), you can take snapshots of the state of the heap and look for objects of interest by selecting the steps. The heap Walker has five views:
Class Classes
Displays all classes and their instances, and you can right-click on the specific class "Used Selected Instance" to implement further tracing. Assigning allocations
Displays allocation trees and allocation hotspots for all record objects. Index References
Provides the ability to display index diagrams for individual objects and paths to the root of garbage collection. It also provides the ability to combine input and output views. Time
Displays a histogram of the resolution time for the logged object. Check Inspections
Shows a number of operations that will parse a subset of the current set of objects under certain conditions, essentially a filtered process. Graph graph
You need to manually add objects to the chart in the references view and biggest view, which shows the incoming and outgoing references to the object, and can easily find the source of the garbage collector.
Tips: Clicking Go to start on the toolbar allows the heap memory to be counted back to the initial state.
3.2.3 CPU View CPU views
Jprofiler provides different ways to log access trees to optimize performance and detail. Threads or thread groups and thread conditions can be selected by all views. All views can be aggregated into different layers, such as methods, classes, packages, or Java EE components. The CPU View section includes:
Access Tree
Displays a cumulative Top-down tree that contains all the access queues that have been recorded in the JVM. JDBC,JMS and Jndi service requests are annotated in the request tree. The request tree can be split according to the different needs of the servlet and JSP for the URL. Hot spots
Displays a list of the methods that consume the most time. A backtracking tree can be displayed for each hotspot. The hotspot can be computed according to the method request, JDBC,JMS and Jndi service requests, and by URL requests. Access Graph Call Graph
Displays a diagram of an access queue that starts with the selected method, class, package, or Java EE component. Methods Statistics Method Statistis
Shows the details of the call time for the method that is logged over a period of time.
3.2.4 Threads View Thread views
Jprofiler determines its state of operation by monitoring thread history, and monitors whether a thread block is generated, and can also render a method managed by one of the threads in a tree form. For threading profiling, Jprofiler provides the following views:
Threads History Thread History
Displays a schedule of activities with thread activity and thread state. Thread Monitoring Threads Monitor
Displays a list that includes all active threads and their current active status. Threads Dump Thread Dumps
Displays a stack trace for all threads.
3.2.5 Monitor views
Jprofiler provides a different view of the monitor, as follows:
Currently locked chart current locking graph
Displays the current lock in the JVM. Current Monitor Monitors
Displays the thread actions that are currently waiting or blocking. Lock History Chart Locking History graph
Displays the lock history recorded in the JVM. Monitors history Monitor History
Shows the history of waiting or blocking. Monitor using statistics monitor Usage Statistics
Calculates the data monitored by the statistics monitor.
3.2.6 VM Remote Sensing Survey Technology view VM telemetry views
Looking at the internal state of the JVM, Jprofiler provides a different view of the remote Sensing Survey, as follows:
Memory Memory
Displays the usage of the stack and the size of the stack activity schedule. The logged object Recorded Objects
Displays a schedule of activities for a chart of active objects and arrays. Recorded production Recorded throughput
Shows a cumulative schedule of activities for JVM production and release over time. Garbage collection Activities GC activity
Displays a schedule of activities for garbage collection activities. Class Classes
Displays an activity schedule with a diagram of the loaded class. Thread Threads
Displays a schedule of activities with the dynamic thread chart. CPU Loaded CPU Load
Displays the load graph of the CPU for a period of time.
3.3 Use Experience
3.3.1 Look at the memory graph
Key 1, focus on the blue part of the image above, you can see that each time the memory goes up to a peak, it falls, and the action is that the GC is reclaiming the memory, and the rate of rise and recovery is probably the same, if you find that the available memory in the memory graph has been rising over time without GC recovery. Then you have to wonder if there is a memory leak;
Key 2, when you suspect a memory leak, you can view mark current Values in the memory views, and then, after a period of time, F4 to find the exception class that has not been released to track it down a step further;
Key 3, tracking the main use of the functions of heap walker, each function can be done what kind of analysis please review chapter