aspose file tools*
The moose likes Performance and the fly likes profilers for j2me applications Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Performance
Bookmark "profilers for j2me applications" Watch "profilers for j2me applications" New topic
Author

profilers for j2me applications

kumar Reddy
Greenhorn

Joined: Nov 24, 2004
Posts: 29
hi all,
i'm new to the field of performance . I want to profile j2me applications running on pda.

could anyone of you let me know existing tools that can serve my purpose?
because have searched in google..many of them specified jdk 1.2 or something as minimum requirement.

I hope that you can help me in this regard.

Thank you
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
You may end up having to profile the J2ME application running in the emulator rather than an actual PDA or phone.
Bill
kumar Reddy
Greenhorn

Joined: Nov 24, 2004
Posts: 29
hi
Thanks for reply..but i could not completely understand your reply....

Is there any difference in profiling the J2me applications in emulator and PDA?

say if i install an emulator and then i will install j2me and my application..could you please let me know how can i profile the j2me application installed on emulator with already existing tools..for ex jprobe, optimizeit,jview2004 etc..

sorry if my question seems to be silly..but i am really new and could not
get the starting point to profile.

hope you can help me in this regard

thank you
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
The problem is that a PDA or phone does not have the resources to support a profiler and your application at the same time. For example, a profiler may need to write huge amounts of event data to a file.
However, if you can find an emulator program that runs on a regular desktop PC, you can have the profiler watch the emulator as it executes your application.
It has been some time since I did this, but the latest Wireless Toolkit from this Sun website
should support this sort of thing. You will also find other handy information at that site.
Bill
kumar Reddy
Greenhorn

Joined: Nov 24, 2004
Posts: 29
hi

That was really a good reply. i gone thru the link that you have given and explored a little about emulators and the way they function.lets keep profiling aside for sometime.

what i came to know from my short research is that there exists two types of emulators which are concept emulators and real-life emulators.

"Another way of looking at the world of emulators is to divide them into concept emulators and real-life emulators. A concept emulator does not represent a specific device but serves to demonstrate the general characteristics of a certain kind of device. The J2ME Wireless Toolkit emulator, for example, is a concept emulator that can be used to represent a variety of MIDP devices. A real-life emulator is designed to mimic the appearance and behavior of an actual device. Such an emulator may run some or all of the binary code that runs on the device itself.
" -- taken from http://developers.sun.com/techtopics/mobility/midp/articles/emulators/

i dont know whether you have heard of "VMWare" which is also just like an emulator that can be installed on a pc and it gives us a new pc environoment with its own harddisk,memory,frequency etc..

so i would like to know if there is any emulator that resembles an PDA.i mean that the applicaion running in emulator should not take up the resources of the system that it was installed on. instead it should take up the resources of the emulator..thereby giving me a real environoment for running my j2me applications.

scenario is i dont install jdk,j2me etc on my pc. i install only my emulator..i should have an option to install j2me on emulator and execute the application . and whenever the emulator is closed , the j2me should be uninstalled automatically(this option is available in "VMWare").

could you please comment about this.
I am sorry if i am not clear.
please help me in this regard.

thank you
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
That is a good point about the two kinds of emulator, however, I think that even with the "comcept" emulator, the way your application code executes should be similar between J2ME versions, and general Java performance considerations should apply.

Do you have a real performance problem in mind, or is this general research?
Bill
kumar Reddy
Greenhorn

Joined: Nov 24, 2004
Posts: 29
hi

I am currently in research phase after which i should be able to test my j2me applications in the real environoment.

The only thing we are striving is to follow the rule of performance gurus that "THE APPLICATIONS SHOULD BE TESTED IN REAL ENVIRONOMENT".

as said by you,yes we can trace the performance problems even when we run on the emulators which takes up the resources of host operating system.our concern is to find out whether the limited hardware resources on PDA's are gonna play some role in performance of the applications.

so could you please give me a suggestion on this?

is my idea wrong of trying to find performance problems executing them in real environoment?

Thank you
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
You are absolutely right about testing in the real environment, but you don't need a profiler for that! It is the user's perception under real use conditions that is most important. If you can get something useful up on the screen in a hurry, it may not matter that behind the scenes you are working frantically to parse some xml.

Old-timers will remember when Sun was first experimenting with the first generation of what became J2ME. I experimented with doing a study guide "flashcard" on the Palm.
Here is a screen shot of that application from the emulator that Sun and Palm worked up.

In the first version I tried, I used String methods to dynamically figure out wordwrap on that tiny screen - it crawled! It would have been very frustrating to the user. The solution was to precompute all of the text lines when creating the application.

So by all means, test in the real environment, but you need a stopwatch, not a profiler.

Bill
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by William Brogden:
So by all means, test in the real environment, but you need a stopwatch, not a profiler.


A stopwatch actually might still measure the wrong thing. Something can already *appear* to be faster just by showing a progress bar!


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12806
    
    5
A stopwatch actually might still measure the wrong thing. Something can already *appear* to be faster just by showing a progress bar!

Ah - but if you are trying to optimize user perception of performance, that is the right thing to measure.
Bill
kumar Reddy
Greenhorn

Joined: Nov 24, 2004
Posts: 29
hi bill and ilja
nice to see ur answers..
ok let me explain my view..but before that i am sorry if i am wrong..

"i did not get why u were mentioning progressbar" .. because its only for feeling pefromance not for improving the acutal peformance of code u have written.

"regarding stopwatch" .. i understood in two ways

First

To start application on pda and measuring the time taken using a stop watch .. but does that give you the exact statistics that JPRObe or optimizeit gives for applications running on PC?

if thats case then why need to buy the commericial profilers..everyone can measure with stopwatches..

Second:

"first to find out the performance bottlenecks on an emulator and solve them and deploy them on the handheld devices and test them in handheld devices with a stopwatch.."

say if i find performance bottlenecks using emulator and improve them and install the improved on the real handheld..is it guranteed that the improvement is reflected?

because i tried to run the same method on PDA and emulator..
on PDA--say 8 ms
with an emulator -- it was 10 ms (surprising)

so what is feel is the emualtors are not worthy for testing the j2me applications

hmm i am totaly new and am not able to get these perfromance concepts..hoping that you can help me in this regard.

thank you
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Originally posted by kod red:
"i did not get why u were mentioning progressbar" .. because its only for feeling pefromance not for improving the acutal peformance of code u have written.


Well, you most probably want to improve user satisfaction, don't you? And you want to get maximum satisfaction for minimal investment (else your users will be dissatisfied by the price of your product). Sometimes a progressbar is better in doing this than actually improving code performance.
steve souza
Ranch Hand

Joined: Jun 26, 2002
Posts: 861
I'm not too familiar with J2ME, but I think it supports the collections and the synchronized key word. If so, JAMon should work. JAMon is pretty lightweight, so it might work out for you.

The link is at the bottom of my posting. Let me know if it works out.


http://www.jamonapi.com/ - a fast, free open source performance tuning api.
JavaRanch Performance FAQ
kumar Reddy
Greenhorn

Joined: Nov 24, 2004
Posts: 29
hi steve

Nice to see you in this forum.

i will try using jamon for cpu profiling, but what about memory profiling as thisis also a major requirement in my environment.

Thank you
[ December 01, 2004: Message edited by: kod red ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: profilers for j2me applications