You Are Here:

Community: Wiki

 

Talk:Code Optimization - Java ME

From Forum Nokia Wiki

I have seen this list several times. Who has written it orginally, and more important, when? Some of the tips are be useful only for old phones.

At least one tip is technically wrong:

In java, you can not set an object to null.

You can only set a variable to null. But this does not affect the object that assigned to the variable. Setting a variable to null creates an extra instruction. So only do it when you know it helps. It can be helpful when

1) the variable does not go out of scope anyway, (e.g. at end of function)

2) the object is bigger, e.g. an image. Then it might help, that the garbage collector gets it.

3) you will not need this image again soon.

otherwise, setting a variable to null is wasting time and space.



Type: Important information

This article provides important information for code optimization. And if you make your application by following this instructions, your application size is automatically optimized up to some level.

--Vkmunjpara 18:02, 20 September 2009 (UTC)



 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia