Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

All Java ME Goodies Consolidated into One SDK : Page 3

The recently released early access edition of the new Java ME SDK (version 3.0) unites Java ME developer tools for CLDC, CDC, Blu-ray Disc Java, and LWUIT into a single SDK. Find out how it works.


advertisement

Notable Features

So, what does this new SDK have to offer? How does it differentiate itself from other tools? Listed below are some of the notable features in the Java ME SDK 3.0.

Profiling

Locating and removing potential performance bottlenecks and memory issues can be an extremely difficult task in any type of application. While the JVM manages memory, you can inadvertently create Java objects that are referenced long beyond their usefulness in an application, creating a de facto memory leak. In Java ME applications, where resources are often very limited, these types of issues can turn catastrophic quickly.

Profilers are tools that let you monitor many aspects of an application as it runs , such as heap, threads, memory consumption, and performance, in order to avoid resource issues in deployed applications. The SDK comes with a profiler that you can use to monitor CLDC/MIDP applications. Again, the profiler is based on the NetBeans profiler that, in turn, uses Visual VM, which is the Sun-provided profiler shipping with Java SE 6.



You must enable the profiler for each device emulator. When you have created an application and it is successfully running on a device emulator, right-click on the device in the SDK's Device Selector window and select Properties. In the device's Properties window, enable profiling by checking the Enable Profiler check box. While there, you may also want to check the location of the file where the profiling data will be collected (see Figure 7 and Figure 8).


Figure 7. Enable a Device for Profiling: In order to profile an application, the profiler on an emulator must be enabled before the application runs on it.
 
Figure 8. Check the Box for Enable Profiler: From the Device Selector window on the SDK, request the device Properties and then check the box for enable profiler.

Figure 9. Location of Profiling Data: As the application exits, the SDK will inform you where the profile data is stored in the Output window.

With the device set to profile, simply run an application on the device emulator to test the code for which you want to collect execution data. Profile data is collected until the application exits. As you exit the application, check the Output window. The location of the profile file will again be listed in the Output window (see Figure 9).

With the profile data collected, select Import Java ME SDK Snapshot… from the Profile menu on the SDK. In the resulting window, enter the location of the profile data as specified in the Output window when the application completed running. A window will display the CPU snapshot taken during the execution of the application (see Figure 10 and Figure 11). The various tabs and granularity settings (package, class and methods) allow you to dig into method invocations and times in order to root out potential issues.


Figure 10. Examine the Profiler Data: To examine the data collected by the SDK's profiler, select Import Java ME SDK Snapshot from the Tools menu. Enter the file name provided by the SDK at the conclusion of the run.
 
Figure 11. Profile Data in the Window: You can then study the profile data in the window provided.

The Java ME SDK does not support profiling of CDC applications at this time. According to Radko Najman from the Sun Java ME SDK development team, a CDC profiler is planned for next version of the SDK.



Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap