Skip to main content

How much RAM would a typical Form object use up?

4 replies [Last post]
dextml
Offline
Joined: 2007-09-19

How much RAM would a typical Form object uses up?
And
Should i always free most of the gui components to release ram when my midlet is put into "paused" state?

Lots of thanks.

Message was edited by: dextml

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
sfitzjava
Offline
Joined: 2003-06-15

The form object doesn't use a great deal of ram, it's what you put on it that might. :)
If you have a form that has several components that take a while to build, such as a choicegroup which needs to build it's selection list from RMS, it might be good to leave that component constructed due to the time it will take to rebuild on resuming your midlet.

Which brings me to the real concerns you should look at, construction time on startup.
While there is a special pause method that is called, there is not a resume method, only the startApp method. So if your construction time for your screen is not that long you can reduce the amount of logic in your startApp method by just rebuilding everything.
What you have to do if you need to keep complex or slow gui components around for startup, is rebuild what you need and make sure that the event/command hooks are re-established. Some devices can cause issues if you leave the command and event listeners, intact when the midlet is in pause mode, so these should be removed in pause and rebuilt in startApp, to avoid your midlet missing actions or dropping the ability to respond to keystrokes.

Have fun.

-Shawn

dextml
Offline
Joined: 2007-09-19

thanks for your info. it's helpful.

I really don't need to care alot about thee memory issue? consider nowadays cellphones vary a lot from one user to another. And,... the cell phones also take great discrenpancy amongst different countries. J2ME is a good platform, but sometimes some mobile phones does not give FULL support to every documented apis which further narrows j2me's ability.

how u think about this?

-dex

sfitzjava
Offline
Joined: 2003-06-15

True memory is becoming less of an issue. However as you point out every phone, country, and provide inflict different restrictions on JavaME, and thus you could end up on a device that had a lot of memory (storage) but not a great deal of memory (ram). So unless you are doing SVG, or Image /graphics intensive apps, or need to load up large DOMs to parse through, memory can drop down a notch in importance.

- climbs onto soapbox -
As for my opinion (which is all it is, my opinion) that phone companies / manufacturers are ruining the JavaME market with their unrealistic restrictions, and faulty implementations of the JSRs and Java APIs, and we need Sun or some 3rd party body to have the power to bring in all of these incompatibilities into line. Also the issue that Sun has not made companies publish in more detail what JSRs and even the fact that Java is on the device is ridiculous. You don't see Windows Mobile devices keeping quiet about what device, level and .net support they have, but yet I can not go to a Wireless phone service provider site and find out if a phone has Java or will support the WMA JSR-120 or 205. Not to mention even if the phone does support it, there is no guarantee that the service provide will allow that support to be active.

Without JavaME getting some major support soon, I fear it will get eclipsed by other technologies.
Sun should take lessons from Palm, who was the undisputed leader in PDAs, and is now struggling to stay in the game. Without innovation and a plan to stay up with the market you fail.
- steps down from soapbox -

:D
Best wishes,
-Shawn

dextml
Offline
Joined: 2007-09-19

You rock.
Thanks a Mega :)
I'm not experienced with mobile development, so i care about every step i made.

PS. actually, there IS some site provides search on devices base on the Java feature they support. Example is the nokia forum.