1. todd123's Avatar
    So I have had my storm since the day it came out. Still running OS .75

    Lately I have been watching MeterBerry and when the available memory gets to around 5mb I start opening up every app on the phone. I thought it might be fun to try to get it to zero and see how the phone behaves.

    I have tried this three times tonight and what happens it MeterBerry indicates that the ram is going up...

    I know it's strange but it is definitely happening, and I'm not nuts or trying to get a rise out of anyone.

    So any ida what might be going on in the OS? Or perhaps is it an anomoly with MeterBerry?
    03-10-09 11:03 PM
  2. jeffh's Avatar
    It's most likely an anomalous interaction between MeterBerry and the OS Memory Management function. The problem for any memory management tool is that it has to execute in the very memory that it's trying to monitor. The OS is also monitoring and managing that memory. You can't turn off the OS functions. So when you try to drive the free memory to 0, the OS Memory Manager will kick in to try to recover memory. MeterBerry may actually be reporting the success of the OS Memory Manager in recovering memory faster than you can use it up, or it may simply be wrong. In any case, you have to decide if the functionality provided by MeterBerry is worth the memory it uses in providing that functionality.
    03-10-09 11:27 PM
  3. MostlyHarmless's Avatar
    It's garbage collection. When a program closes, not all of the memory it used up is freed right away. As you continue to open and close programs, available memory can (and should) start to fall until it goes below some threshold as defined in the OS, at which point garbage collection kicks in and begins to free up memory.

    There are a couple of reasons for this behavior.

    The first is that garbage collection is expensive from the standpoint of processing resources. The processor needs to go through all of the memory that has been allocated, determine which segments of data or code are no longer needed, and clear them out. It also involves reorganization of allocated memory to prevent fragmentation of free ram. Needless to say, it's in the best interest of the user to not have this happen unless it's absolutely needed.

    The second reason is that it's a form of temporal caching. By leaving an application's code and data structures intact in RAM after it's closed, you can reuse all of that if the user opens to same app again, which can provide a modest increase in app load speeds as well as reducing the amount of work the OS needs to do from a memory management perspective.

    To sum it up, what you're seeing is actually completely normal behavior.
    Last edited by MostlyHarmless; 03-11-09 at 05:39 AM.
    03-11-09 05:36 AM
  4. todd123's Avatar
    I appreciate your responses. It makes sense now.
    03-11-09 07:45 AM
  5. oakindustries's Avatar
    It's garbage collection. When a program closes, not all of the memory it used up is freed right away. As you continue to open and close programs, available memory can (and should) start to fall until it goes below some threshold as defined in the OS, at which point garbage collection kicks in and begins to free up memory.

    There are a couple of reasons for this behavior.

    The first is that garbage collection is expensive from the standpoint of processing resources. The processor needs to go through all of the memory that has been allocated, determine which segments of data or code are no longer needed, and clear them out. It also involves reorganization of allocated memory to prevent fragmentation of free ram. Needless to say, it's in the best interest of the user to not have this happen unless it's absolutely needed.

    The second reason is that it's a form of temporal caching. By leaving an application's code and data structures intact in RAM after it's closed, you can reuse all of that if the user opens to same app again, which can provide a modest increase in app load speeds as well as reducing the amount of work the OS needs to do from a memory management perspective.

    To sum it up, what you're seeing is actually completely normal behavior.
    Brilliant post, that should be archived someplace.
    03-11-09 09:11 AM
LINK TO POST COPIED TO CLIPBOARD