Skip Headers
Oracle® Java Micro Edition Software Development Kit Developer's Guide
Release 3.3 for Eclipse on Windows
  Go To Table Of Contents
Go To Index


8 Profiling Applications

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. This chapter describes how to set up profiling.

The SDK supports offline profiling. Data is collected during the emulation session. As you view the snapshot you can investigate particular methods or classes.


This feature might slow the execution of your application.

8.1 Collecting and Saving Profiler Data in the IDE

This procedure describes interactive profiling. To run profile an application from the command line, see "Command Line Profiling."


The profiler maintains a large amount of data, so profiled MIDlets place greater demands on the heap. To increase the Heapsize property, see "Setting Device Properties."

  1. Select a project.

  2. Select Run >Profile As... >CPU Profiler (alternatively, you can right-click the project and select Profile As and then CPU Profiler from the context menu).

  3. Interact with the application MIDlet as you normally would.

  4. Exit the MIDlet.

    You are asked if you want 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.

  5. To export the profile data, click the File menu and select Save As. The file is saved as a PRF file in the project directory in your workspace.

8.2 Loading a .prf File

A previously exported .prf file ("Collecting and Saving Profiler Data in the IDE") can be loaded at a later time.

Follow these steps to retrieve profile data:

  1. Click the File menu and select Open File... .

  2. Browse to the .prf file you want and click Open.

The Profiler opens in its own tab labeled cpu:filename.


The profiling values obtained from the emulator do not reflect actual values on an external device.