Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Aug 2008

    Overhead in using static class

    i want to know what is the overhead, in using a static class with some static members, in j2me during the whole lifecycle of the midlet..

    Also do tell me if any other problem persists....

  2. #2
    Regular Contributor
    Join Date
    Aug 2008
    Bournemouth, UK

    Re: Overhead in using static class

    i believe that static classes are less resource intensive that instantiable ones. theres no construction involved and no references for the vm to use so in theory id say there are certain perfomance gains to be had if used properly, someone please correct me if im wrong
    Made With Caffiene And Sleepless Nights

  3. #3
    Nokia Developer Expert
    Join Date
    Jun 2005

    Re: Overhead in using static class

    Static methods and variables are usually very fast. However it's not wise to keep large objects in static fields, since those remain alive for the whole MIDlet life, preventing these large objects from being released and garbage-collected.

    So, the rule of thumb is: methods and small objects is ok. Large objects = not OK.


Similar Threads

  1. java cimd application
    By vandana14 in forum General Messaging
    Replies: 3
    Last Post: 2011-04-07, 16:04
  2. need information about j2me polish
    By rathikathangaraj in forum Mobile Java General
    Replies: 4
    Last Post: 2007-12-19, 09:01
  3. Container Class needs help
    By vinayashrestha in forum Symbian User Interface
    Replies: 3
    Last Post: 2007-11-14, 12:54
  4. 21 errors in j2me , help in soving them
    By abhishek_1211 in forum General Messaging
    Replies: 0
    Last Post: 2006-04-01, 09:04
  5. Static class members not allowed?
    By cbrueckner in forum Symbian
    Replies: 7
    Last Post: 2003-07-09, 18:08

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts