Sun Microsystems J2ME manual Using the Memory Monitor, Saving and Loading Profiler Information

Models: J2ME

1 134
Download 134 pages 62.02 Kb
Page 54
Image 54

5.1.3Saving and Loading Profiler Information

To save your profiler session, click on the Choose a file name.

Save button in the profiler window.

To load a profiler session, choose File > Utilities... from the KToolbar menu. Click on Open Session in the Profiler box. When you select a file, the profiler window appears with all the session information.

5.2Using the Memory Monitor

Memory is scarce on many MIDP devices. The J2ME Wireless Toolkit includes a memory monitor that makes it easy to examine the memory usage of your application. You can see the total memory used by your application and a detailed listing of the memory usage per object.

To turn on the memory monitor, choose Edit > Preferences... from the KToolbar menu. Click on the Monitor tab. Check Enable Memory Monitor.

Next time you run the emulator, the memory monitor window pops up, displaying a graph of your application’s memory usage over time. The memory monitor slows down your application startup because every object created is recorded.

FIGURE 22 The memory monitor graph

The memory monitor graph shows the following information:

Current. The current amount of memory used by the application.

42 J2ME Wireless Toolkit User’s Guide • October 2004

Page 54
Image 54
Sun Microsystems J2ME manual Using the Memory Monitor, Saving and Loading Profiler Information