Optimizeit Profiler Overview
This article introduces some of the main features of Optimizeit Profiler to make you a brief understanding. If you want to know more, please see the Optimizeit Profiler User Manual. You can click on the Main Menu INFO | Help from the Optimizeit Profiler to view all documents.
If you have any questions, please feel free to contact Borland Technical Support.
Launch application
Optimizeit Profiler collects useful information by running applications on a separate virtual machine.
Optimizeit Profiler collects useful information by running applications on a separate virtual machine.
Optimizeit Profiler collects useful information by running applications on a separate virtual machine.
You need to install a Java virtual machine before running a Java program. Optimizeit Profiler Default Configuration is JDK 1.4 OR
1.4.1. If you want to use additional virtual machines, you can view how to add additional virtual machine parts in the Optimizeit Profiler user manual.
Optimizeit Profiler can be used to test any type of Java program: standard applications, application applets, servlets, JSP, EJB, etc. All of this article uses a demos, which are included in the Optimizeit Quichktour directory. All demonstrations in this paper can be done.
1. Open Optimizeit Profiler;
2. If you are open, you will automatically pop up the editing settings window. If you have already opened, you can select New Setting from the File menu to call the Edit Settings window.
3. Select Application in the Program Type box.
4. Click the "Browse ..." button on the right of "Program Main Class or Jar File".
5, find the /Doc/profiler/quicktour/quicktourapp.jar file, and then click Open.
6, PROFILER will return to the setting window and automatically bring the program's workspace and class path. In the Source Path box, click the Change ... button.
7. In the Source Path Chooser window, select the / Doc / Profiler / Quicktour directory under the installation path; select the /Doc/profiler/quicktour/quicktourapp.jar file, click the down button in the window to add it to the Source Path section. .
8. Click OK to add to the source file. Set the good dialog box as follows:
9. Click the Start Now button.
10. The editing window will automatically turn off, and the Optimizeit Profiler is automatically loaded.
Using Memory Profiler
When you use this tool for the first time, Optimizeit automatically opens to the memory monitor window:
The memory monitor lists the number of instances of all classes in the test program and real-time statistics. The memory monitor is open in heap mode by default, which can see the creation and revoking of the object. The following steps will show how to control the memory monitor to analyze the memory usage of the test program:
1. Click Instance Count in the Monitor Monitor. This will be arranged in descending order according to the number of allocated instances.
2. In the Filters window below the memory monitor window, enter a class you want to observe, enter java.awt. * In the Filters box, and press Enter key; this will only display information about the Java.awt class .
3, we can see that many of the counts of instances either increase, either decrease. Increase is because there is an example generation, and the decrease is because garbage is active. If you want to view the creation of a temporary object, you can select the Disable Garbage Collector button at the bottom of the window, so that Optimize will continue to display the number of all instances. 4, select the Java.awt.color class, then click the Allocation Backtrace button to enter the Allocation Backtrace mode. You can also double-click on the class name. The BackTrace information shows the information called by the method in each instance of the class.
5. In the Allocation BackTrace view, you can view the information in two ways:
l Hierarchical View hierarchical mode The tree diagram is displayed by default. In the tree diagram, a method may be displayed in multiple places, who calls this method. However, in the graphical view, the method representation represents only once. It still has multiple parent paths.
l in the aggrecated View Chart Mode Each node will connect to the line or only one side between the boundary. From multiple sub-nodes, each connection corresponds to a method of calling this method. Different from the tree, there may be loops in the chart. The chart display helps to track. If you want to find out how a statement is called, the chart will be a quick and easy way, and you can quickly find objects with parent-child relationships through charts.
You can use buttons to switch between two ways.
6, select the EventDispatchThread.Run () line, click the plus number to the left. Click the largest node with the largest ratio until the graphics2d.fill3dRect () behavior is expanded.
7. Double-click the graphics2d.fill3dRect () line, the source code allocated by the color instance is displayed. Sourcecodes will help you understand why the drawing path creates so much instance. The Fill3DRect method allocates a lot of colors because it calls the Color.brighter () method and color.darker () method.
Note: If you are the first user, you may not have the source code path in the figure.
Using a memory monitor, you can help you create less temporary objects. Although temporary objects are often destructed, it will lead to garbage collection more frequently. For most Java virtual machines, when the garbage collector is relatively busy, running any Java programs will delay a few hundred milliseconds. If too many temporary objects are used, because this reason will cause the user to feel slowly.
Memory Monitor simultaneously helps understand why garbage collectors do not destructure these objects. For example, it will help us understand that it is indeed a garbage collector when an object is no longer used. The following steps describe the use of a memory monitor to determine the generation of an instance and how the garbage collector is collected.
1. Click the icon to return to the heap mode.
2, in order to display only class related to Image-Related, you can clear the contents in the Fileters box, then enter * image *, then press Enter.
3, select Javax.swing.Imageicon line, then click the icon (display instance and reference map), show the example diagram:
The above top of the window shows the character description of the instance.
The window intermediate section shows the selected instance object reference and the instance derived by the object. In this case, because the ImageICON object is referenced, the garbage collector is not collected.
The bottom part of the window displays the allocation path of the selected instance of the intermediate window. It can be seen that the example is the constructor QuickTourapp assigned. This image is the logo of Optimizeit in the middle of the program as a background.
Memory leaks are often cited in succession in program operation, so they still take up resources. Because of this, if you can locate an object using a large number of references, you can locate the root cause of the object occupation resource results in memory leakage. In order to be able to locate an object using a large number of references, and track these references: 1. Open memory leak detection, click the memory leak monitor button
.
2. In order to find possible memory leaks, Profiler needs to compare a series of stacks. You can click Save Stack Status button
Create.
3, let the QuickTour program run more than 15 seconds.
4. Click the Save Stack Status button again to record a new stack status record. You can create multiple stack of status records.
5. The future of the future is the initial state of the comparison, and the TO Heap State table is a state in which the from HEAP State is compared. Whenever the record in the FROM HEAP State table, the record can only be selected after the record in the TO Heap State table.
6, the intermediate portion of the window shows the resources that are newly referenced after the comparison state record. COUNT value is the number of increment references this object. You can click on the COUNT header. You can choose a reference to see all object references related to this object reference in the stack state.
7, the objects in the figure will have a connection line or boundary. From the root node, there is a corresponding reference. Move the mouse to the node, will display the number of new references and the node call toString (). The instance variable name of this reference will be displayed on the final node.
8, there are two scroll bars above the figure:
Use the detailed degree scroll bar to adjust the detailed level of the chart display.
Use the zoom scroll bar to adjust the size of the chart display.
All different colors represent different meaning:
l The blue node is an indirect reference handle. It is not directly referenced, but references are referenced.
l The red node is a reference handle. Indicates that it is directly referenced.
The more references to the node, the deeper the color.
l Subsequent connections are shown as green lines. Subsequent connections are a higher level of reference for an object in the reference. All subsequent connection borders are blue. Continued connection in the reference level is a reference for subsequent connections.
l After selecting a node, references related to this node will flash.
l Select a node and click the right mouse button to open the selected node in a new instance.
Use CPU Profiler
The memory monitor helps to minimize objects. The CPU monitor will help you understand the time used by the object. The CPU monitor can be seen as a record device in the Java virtual machine. The following steps describe how to give the response time and CPU usage of the subject.
1. Click the CPU monitor button to switch to the CPU monitor interface.
2. Click Start CPU Monitor button to start the CPU usage of the program.
3, let the program run for a period of time (such as more than three seconds).
4. Click Stop CPU Monitor button to stop recording. The CPU monitor shows the recorded CPU usage information.
5. If you don't have selected, select the tree format, see the information is the same.
6. Click the drop-down box above the window to display the virtual machine currently running all threads.
7. Select the AWT-EventQueue-0 Thread thread that is used by AWT to process time, such as Repaint events.
8. Expand the EventDispatchthRead.pumponeEvent () line.
9. Click EventQueue.dispatChevent () to expand all methods until you expand to the jcomponent.paintwithbuffer () method. The icon in front of the line means:
Indicates that the method is directly called by another method.
A method indicating the longest execution time.
In this example, the AWT-EventQueue-0 thread has always been used to process the Repaint event.
10. Select the Jcomponent.PaintwithBuffer () line. If the mouse is moved to the method called by JComponent.paintwithBuffer (), the time proportion used in this method is displayed in the JComponent.paintwithBuffer (). 11. If you want to analyze that thread is idle, the CPU monitor can simultaneously display the CPU usage and usage time. Click Inspector (under the Tool menu) to open the Inspector dialog.
12. Do not select the Ony Record CPU Usage, then close the window. Using this feature to select a buffer policy, the default is displayed in CPU pure use information.
View virtual machine information
OptimizerT provides information about high standard performance tests related to data in real time. Using this feature, you can understand that the performance problem is related to the CPU or related to memory, or is related to both.
Click
Switch to the virtual machine mode.
In this mode, the four types of performance icons are displayed, and each type of chart describes the different activity information of the virtual machine:
Stack of chart: The red line in the left corner of the upper left corner indicates the size of the stack of the quenching program, and green indicates the size of the stack actually used by the test program.
Garbage collection chart: There is shown in the drawing of the upper corner showing the activity of the current garbage collector, showing the proportion of the total time of garbage collection time. Helps to observe the frequency and time used in garbage collectors.
Threadmap: The red line in the lower left corner represents the currently running thread, green represents most threads use the CPU.
Category: The figure in the lower right corner shows the number of classes currently loaded with virtual machines.
View test results
Optinize is a number of methods to view test results, just like the real-time monitoring method above, you can save all information in a snapshot or report so you can analyze results or compare with another result. .
For example, you can output the test results as an HTML file.
1. When the demo is still running, click the CPU monitor to return to the CPU monitor interface.
2. In order to view all information, fully expand all methods. Verify that the information you need is displayed in the hierarchy, because the chart is not included in the output.
3. Click the output icon to open the output window:
4. Fill in the title, check the path in the filename box is valid, and select the output to .html format.
5. Click OK, Optimizeit will output the result to the defined .html file, and then open.
Now you can share your test results.
This article is just an overview of the Optimizeit Profiler. If you want to learn more about Optimizeit, please see the Optizeit Profiler User Guide.
Translation: WyingQuan At Hotmail Dot COM Time:
2004-11-5
If you are interested in this article or a white box test, please visit http://groups.yahoo.com/group/whiteboxtestcn/, join the member, you can download the complete content of this article (format is a Word document with a picture), There are also some other white box test tools and related discussion.
If you are interested in this article or a white box test, please visit http://groups.yahoo.com/group/whiteboxtestcn/, join the member, you can download the complete content of this article (format is a Word document with a picture), There are also some other white box test tools and related discussion.