×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Mar 2003
    Location
    IL/USA
    Posts
    341

    RMS record sizes.

    Hello.

    My Environment;
    - Nokia E61 / Series 60 3rd Edition
    - MIDP 2.0/CLDC 1.1
    - Memory: 50MB, I think.

    I have RMS tables that have variable length records;however, I can estimate the maximum size for a record in each table. The estimated sizes are;

    RMS Table A:4935 bytes
    RMS Table B:2086 bytes
    RMS Table C:2441 bytes
    RMS Table D:2483 bytes

    Would it be to wasteful if I created RMS records with max size that a record can occupy? For instance, when writing a record to "Table A", I would do the following;
    Code:
        byte[] outbuf = new byte[4935];
       fill_table_a_data(outbuf);
       RecordStore rs = RecordStore.openRecordStore("A", true);
       rs.addRecord(outbuf, 0, outbuf.length);
       rs.closeRecodStore();
    Regardless of actually size of a particular record, it's max estimated size is always allocated.

    For reading record from "Table A" I would do;
    Code:
        byte[] table_a_buf = new byte[ 4935 ];
        RecordStore rs = RecordStore.openRecordStore("A", false);
        rs.getRecord( some_recordID, table_a_buf, 0, table_a_buf.length );
        rs.closeRecordStore();
    
        // sometime later in the program I would do
        if (byteCompare( table_a_buf, NAME_OFFSET, "FUP" )) {
            doSomeAction( table_a_buf, NAME_OFFSET );
        }
    I don't know the minimum around of memory RMS consumes per record, for instance, a record of length 20 bytes would occupy 1K of RMS records so 1024 - 20 is being wasted, but if it's >= 5 4935 then it would not lost anything.

    Also I do not have to keep creating a new buffer everytime I read a record from "Table A".

    The above sizes are estimated by DBA that mobile will download from server, on average it could be a lot less than the maximum estimated size.

    Another strategy would be to try to compute the average size of each record and only increase buffer when needed but I lose befenits of static size records, namely, I can't do something like;
    Code:
        if (compareBytes( table_a_outbuf, OFFSET_OF_NAME )) == 0) {
           doSomeActions();
        }
    What do you guys think? Will I quickly exhaust RMS memory with this method? I believe that all devices will be using memory cards of at least 50MB but i'm not sure. and there can be about 300 records so RMS would require;
    "Table A": 1445K
    "Table B": 611K
    "Table C": 715K
    "Table D": 727K
    -----------------
    Total: 3498K

    Also, records get deleted often, and I don't know how this affects RMS, for instance, what happens to the space allocated by the record store?

    If RMS becomes full, I can post a message to user telling them to delete RMS Tables and resync with server to defragment RMS if deleted records consumes space in a RMS table.

    I would appreciate any input on this. I have already read document at Sun on RecordStore but I didn't find it useful for answering this question.

    Thanks!
    Erica A Ramsey / Mobile Apps Developer /
    Resume ~ http://home.comcast.net/~erica.ramsey/CV
    Some Project Screenshots ~ http://home.comcast.net/~erica.ramsey/CV/screens.html

  2. #2
    (Retired) Nokia Developer Admin.
    Join Date
    Jan 2006
    Location
    Michigan
    Posts
    4,664

    Re: RMS record sizes.

    Hello earamsey

    I asked the experts but I wasn’t able to resolve your problem, the discussion boards are meant for simple quick answers and not something that requires a lot of engineering effort and this question requires that.

    If no one else can help you here, you can try our tech support group but there is a small fee for that help. They can then create an incident report and do the necessary research to find an answer.

    Thanks for trying the discussion boards first. We try to help as much as possible but some times it just requires engineering support.

    Ron

Similar Threads

  1. Modify Record Using RMS
    By jaceline in forum Mobile Java General
    Replies: 1
    Last Post: 2006-03-13, 13:48
  2. Size limit of a single RMS record ?
    By civax in forum Mobile Java General
    Replies: 0
    Last Post: 2005-12-27, 12:55
  3. RMS storage sizes for Nokia phones?
    By nokiafin in forum Mobile Java General
    Replies: 0
    Last Post: 2005-02-16, 11:43
  4. Deleting a Record (RMS)
    By clv2k2 in forum Mobile Java General
    Replies: 2
    Last Post: 2003-10-03, 13:31
  5. Bugs on delete record on RMS for 3650 device
    By dssnokia1 in forum Mobile Java General
    Replies: 6
    Last Post: 2003-09-29, 13:50

Posting Permissions

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