Tech Tip: The Reality of RMS
The realities of using RMS are very different from what the text books would have you believe. First of all, RMS limits are not documented anywhere. Often times the only way to determine exactly how much storage space a given device has is to create a MIDlet that litterally fills the RMS until a RecordStoreFullException is thrown. Because of restrictions imposed by the JVM, you cannot assume that because your phone has 1024k of storage that your MIDlet will have access to that full amount.
The realities of using RMS are very different from what the text books would have you believe. First of all, RMS limits are not documented anywhere. Often times the only way to determine exactly how much storage space a given device has is to create a MIDlet that litterally fills the RMS until a RecordStoreFullException is thrown. Because of restrictions imposed by the JVM, you cannot assume that because your phone has 1024k of storage that your MIDlet will have access to that full amount.
How much space do I really have?
MIDP Implementations vary greatly in their implementation of the RMS spec. Some JVM’s rely on the JAD property MIDlet-Data-Size to determine what the storage limits will be for a MIDlet. Other devices (such as the Sprint SANYO devices) have an arbitrary limit of 64k per MIDlet eventhough the device obviously has more storage capacity.
Yeah, but my data is less than 64k but I still can’t add my record …
Individual records in a datastore are stored as byte arrays. On some devices, such as the Sprint Samsung and Sanyo device, there is a limit to how large an individual record can be … and often it is less that the maximum theoretical limit of the RMS. What this means is that you have to “chunk” your data into segments that will fit into the record limit (we found that chunks of 1000k did the trick).

