02-13-09 11:00 AM
27 12
tools
  1. JRSCCivic98's Avatar
    Why do so many posts about the different OS upgrades contain information about what people's memory usage?

    Blackberries are Java devices and Java clears memory "whenever it feels like it". So any details on what your memory usage was before/after an upgrade to a particular OS version are basically useless.
    Even "fresh boot" numbers are suspect as you have no idea if garbage collection was run during boot.

    My Java knowledge comes from J2SE which will frequently fill however much memory is allocated to the JVM before doing GC.
    If there are any J2ME/Blackberry geeks in the forum please correct me if I'm wrong.


    Otherwise I would like to humbly request that everyone stop caring about memory usage.
    Tell that to all the people in the past with older OSs on older models that would have their info deleted when their phones ran low on memory. 8xxx series phones were notorious for doing this.

    Posted from my CrackBerry at wapforums.crackberry.com
    02-13-09 10:39 AM
  2. koan00's Avatar
    Ok, some interesting results.
    I made a quick and dirty app which does the following on my Storm:
    Code:
    Total Memory:
    77982996
    FreeMemBefore:
    59530392
    FreeMemAfterGC:
    59893001
    (take those values with a grain of salt, as I've run the GC a few times during my testing, the initial differences between "Before" and "After" where much bigger originally)

    None of those values match what is in "Options->Memory->Application Memory" (which is currently at 16.7MB).
    What doesn't make sense there. You have ~77982996 total and 59893001 free after GC. That is about 18089995 bytes in use, which is about 17 MB. Very close to the reported 16.7MB.

    Even weirder, sometimes "Total Memory" changes, but that actually agrees with what is in the documentation:


    Also interesting, according to VZ: BlackBerry® Storm™ 9530
    The Storm has 196MB RAM, so there must be a different space allocated for applications to run in. Otherwise I'd expect "Total Memory" to be the full 196MB.
    There are 2 reasons for this.
    1) There is most l likely an OS l ike layer beneath the JVM, and it needs/consumes some of the ram.
    2) Java does not normally allocate all ram at a time. Generally memory parameters are set something like "Use up to amount X, but allocate it as needed in chunks of Y". X is the ceiling, Y is the minimum chunk size to reduce allocations and memory fragmentation. Look at the -Xmx and -Xms JVM options for the J2SE for more info..
    02-13-09 11:00 AM
27 12
LINK TO POST COPIED TO CLIPBOARD