Oracle® Java Micro Edition Software Development Kit Developer's Guide Release 3.2 for Eclipse on Windows E37550-02 |
|
Previous |
Next |
The Oracle Java ME SDK supports performance profiling for Java ME applications. The profiler keeps track of every method in your application. For a particular emulation session, it figures out how much time was spent in each method and how many times each method was called.
The SDK supports offline profiling. Data is collected during the emulation session. As you view the snapshot you can investigate particular methods or classes.
Note: This feature might slow the execution of your application. |
This procedure describes interactive profiling. To run profile an application from the command line, see Section 11.3.3, "Command Line Profiling.".
Note: The profiler maintains a large amount of data, so profiled MIDlets place greater demands on the heap. To increase the Heapsize property, see Section 5.4, "Setting Device Properties." |
Select a project.
Select menu Run > Profile or right click project Profile As > CPU Profiler.
Interact with the application MIDlet(s) as you normally would.
Exit the MIDlet.
You are asked if you would like to transfer the profiling data to a profiler. Choose Yes.
The profile data is automatically displayed in a tab labeled cpu:time, where time is the time the data was displayed.
In the IMP-NG emulator the data transfer occurs when you press the Stop button.
To export the profile data, choose File > Save As. The file is saved as a PRF file in the project directory in your workspace.
A previously exported .prf
file (Section 7.1, "Collecting and Saving Profiler Data in the IDE") can be loaded at a later time.
Follow these steps to retrieve profile data:
Select File > Open File...
Browse to the .prf
file.
The Profiler opens in its own tab labeled cpu:filename.
Note: The profiling values obtained from the emulator do not reflect actual values on a real device. |