File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java Micro Edition and the fly likes how much ram I can use? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "how much ram I can use?" Watch "how much ram I can use?" New topic

how much ram I can use?

mohsen fakhary

Joined: Aug 16, 2011
Posts: 6
Hello every one

I guess this is a trivial question and should be answered a hundred times before but probably I'm not on using right keywords.
How do you know how much memory you are allowed to use?
You may say it depends on ram size of your phone model, but users may have a variety of models. Suppose I can limit used models, but how can I find ram size of a specific phone model (which I don't have in my hand)?

I really hope some one can help me.
Any thing and any clues are appreciated.

Thank you in advance
Walter Gabrielsen Iii
Ranch Hand

Joined: Apr 09, 2011
Posts: 158
I'd say 1024 kB, maybe 2048 kB. Anything more is just padding.

Originally, Java ME was targeted for devices with: "At least 192 KB of total memory available for the Java platform" --Java ME Platfor SDK 3.0 - Help > CLDC and MIDP Stack.

These days Java ME uses the Mobile Service Architecture (MSA) stack with extensions (JSR 248). From JSR 248 Specifications, 7.2 Hardware Requirements:

7.2.3 Java Heap Size Available to MIDlet

Clarification ID: CID.248.3

Under normal conditions (see the definition below), a compliant implementation MUST ensure that Java heap size available to a MIDlet is at least 1024 kB. Further, under normal conditions, a compliant implementation SHOULD ensure that Java heap size available to a MIDlet is at least 2048 kB.

Normal conditions are defined as follows:

.) A new, "out of the box" device is switched on, and a MIDlet suite is installed. There is only one MIDlet in a MIDlet suite.

.) The device is switched off and then switched back on. The MIDlet is started.

One reference method to test the Java heap size requirement is defined as follows:

.) A MIDlet started under normal conditions is able to successfully allocate fifteen (15) byte arrays, of size 64 kB each. (Note: The number of byte arrays is intentionally 15 rather than 16, because it is assumed that the remaining 64 kB are used to store the MIDlet's class files in their runtime form, and to store the MIDlet’s internal runtime data structures.)

Here is sample code that illustrates this test method:

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: how much ram I can use?