Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Jul 2004

    About Array of Byte & Int

    Hi there, i am a newbie on Midlet and have a question on 2 dimension array.
    I want to know how BIG exactly a 2 dimension or maybe a 1 dimension array can be define and use in Midlet without causing the "out of memory" error on series 60 phones.
    Honestly i want to use an array of byte[120][160] or int[120][160]

  2. #2
    Registered User
    Join Date
    Jun 2004

    afaik there is a limitation of the size of a jar file. each limit is described in the device specification of your nokia handy at forum.nokia.com.

    so lets say u use a byte array 120 x 160

    120 x 160 = 19200 fields. each fields uses 8 bit (storage space for a byte var)

    19200 * 8 = 153600 bit makes 19200 byte (18,75 kb)

    for int this would be

    19200 * 32 = 614400 bit makes 76800 byte (75 kb)

    AFAIK the RAM (not the storage of my flash ram card!!!) size of your handy is limited too, i am using a nokia 6600, so my ram is limited to 95 kb.

    so when this 95 kbs are full my handy has to swap. but i am not sure if handys can do that!!!

    if they cant, u will get an outOfMemory exception if your ram reaches 95 kb!!

    hope i could help

    gr Franz

  3. #3
    Registered User
    Join Date
    Jul 2004
    Thank you very much.
    I am using a nokia 6600 too.
    So it seems it's not possible to use INT as it EAT nearly all the avaliable memory but byte can do. thx

Posting Permissions

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