How Memory Management Applications Work and How to Save Money

Comments

There are a ton of memory improving apps in App World and the Mobihand Network. They all offer different feature sets, but the common feature is that they all claim to free up memory. So how do they do this? To understand, you need to know a little about how the Java Virtual Machine works and a process called Garbage Collection. Garbage Collection is the process of automatically freeing up objects that are no longer referenced by the program.

Java uses an automatic garbage collector to manage memory. When the developer writes an application, they are going to determine which objects are created and use memory and the Java runtime is responsible for recovering memory that is unused. If no references to that object are made, the garbage collector can free up this memory. This is often where memory leaks happen. If references to an object remain, but that object is not in use, you begin to see the effects on your device.

The Java Virtual Machine (JVM) works by performing garbage collection automatically when it needs more memory to continue running. On a BlackBerry, this happens every time you do a hard reset. Almost all developers know that there is a simple way to tell the JVM to initiate garbage collection, which may (or may not) result in memory being freed up. This is about as much as all the memory apps you see floating around will do: invoke the garbage collector (when it was going to be invoked anyways).

I don’t want to point fingers at any particular memory management application, because some will offer decent features such as the ability to see more in depth analytics about your memory usage. These features can be very helpful for those on a tight data plan. What everyone should know, is that with some very basic memory management tips, you will get the exact same, if not better, results. In the end, it’s buyer beware.

Take advantage of our Memory Management Guide and you’ll save yourself a lot of money.

  • DavidB

    Very true, MANY of these memory management apps are more a way to get your money than for you to improve the performance of your device. That said, being able to invoke garbage collection on demand without having to do a hard reset would be nice and RIM should just include a utility in the OS to do so. More than just what the “Memory Cleaner” bundled app (which really does not much of anything really) can do. And eliminate the market for these memory apps.

  • Peter

    Hey Kyle,

    I think it’s great that you’re publishing these kinds of informative articles. If I can add a little tidbit, here’s some info about how the garbage collection system works on the BB:

    There are a few different kinds of garbage collection that take place on the device. For those interested, see here: http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800451/800724/How_To_-_Interpret_GC_messages_in_the_Event_Log.html?nodeid=1498929&vernum=0

    The biggest thing to note is that the underlying device software has access to memory statistics that 3rd party applications do not. The native memory manager is far better equipped to determine and execute memory cleanup because it has a full view of the active memory state. Developers have access to only one call that can potentially affect the global memory state on the device: System.gc() (or rather, Runtime#gc()). In fact, as you mention, simply calling System.gc() can do nothing depending on the state of the VM.

    In this sense, 3rd party developers really have no REAL control over the device’s global memory state.

  • http://www.blackberryinsight.com/ k

    Kyle, I think you (like many other people) mix up very important differences:

    1. Memory does not equal space
    Your screen shot in the top is about space or better disk space which the BlackBerry refers to as “memory”. This is totally misleading because memory can mean a lot of things. The memory improving applications do not do anything with your space and therefore, you will not see any effect in the screen shot shown here (when you use such memory applications).

    2. Memory is RAM
    So as these memory apps do not do anything with the disk space, what do they work with? From computers we all know hard disk drives (HDD) and RAM (Random Access Memory). These memory apps work on the RAM. Which is memory too as you can see.

    3. Memory / RAM boosting
    The garbage collector actually takes care of that RAM automatically. However, for some reason the BlackBerry's garbage is configured as seldom as possible. This leads in a longer battery life but the device might appear slower. So such memory boosting apps (I like these names :)) make sure the garbage collection happens more often which improves the BlackBerry's speed. At least it feels like it.

    4. A tight data plan
    As memory is RAM a tight data plan has nothing to do with this topic. There is no data transfer happening with these memory apps. I would loose that comment :)

  • Peter

    k I'd like to address your points if you don't mind:

    1. Memory DOES equal space. On the blackberry platform, transient and persistent flash memory are at a premium. These two are considered memory from the standpoint of the end user. It is important to note that memory “boosting” applications have absolutely no control over these mechanisms. The end user does not usually see nor care about RAM, unless the VM throws an OutOfMemoryException

    With respect to garbage collection, the memory manager will initiate a full GC when the backlight turns off, the device is locked, and many other idle states. The depletions in memory that people often see are due to poor java programming practices. Leaks in java are due to concrete references being built up in data structures over time and not released.

    2. Memory boosting applications can't (as in it's not possible) ensure that garbage collection happens more often. This is purely perceived. If you notice your memory dropping, you have to think about what kind of memory it is and how it impacts your device. If flash memory is dropping due to transient flash consumption, it's not something that a 3rd party application like a memory booster can fix.

  • http://www.blackberryinsight.com/ k

    Peter, I was only referring to actual memory that is used by applications during their runtime. This is “memory” for me.

    I think the user needs to care about “RAM”. Why? Well, the more objects are flying around and not collected by the GC the more memory is wasted. Yes, bad techniques are bad and a GC cannot do anything about that. But that's not the point.

    Make it simple: Every time my Curve 8900 had such a slow response time, I opened the menu and hit “Boost Memory!” (I am a MemoryBooster user and also tried other such apps too). Every single time the memory was “boosted”, the GC was fired (the hour glass was showing) and I got a message “xx MB recovered”. I don't know if it was actually that much, but what I know is: the device responding a lot faster right after it. That's a fact, nothing to discuss. I used that probably a couple thousand times and it was always like that.

    I am feeling it works and that's all that matters :)

  • http://www.blackberrycool.com/ Kyle McInnes

    I think the “I am feeling it works and that's all that matters” is exactly what's wrong with a lot of these applications. If they aren't doing anything you can't accomplish with some basic house cleaning, then users should know to avoid buying these apps.

    Take NetworkAcc for example. That app is filled with reviews of users not knowing if the app did anything at all (it doesn't). So if their network is running a little faster, they'll associate it with the app and think they're getting value they actually aren't.

    In the end, it's BlackBerryCool's job to educate the users about what a 3rd party app can do, and whether these claims are factual, to avoid a placebo-type effect that cheats the user out of their hard-earned money.

    There are so many apps out there that provide real value for money. Let's focus on those.

  • http://www.blackberrycool.com/ Kyle McInnes

    I think the “I am feeling it works and that's all that matters” is exactly what's wrong with a lot of these applications. If they aren't doing anything you can't accomplish with some basic house cleaning, then users should know to avoid buying these apps.

    Take NetworkAcc for example. That app is filled with reviews of users not knowing if the app did anything at all (it doesn't). So if their network is running a little faster, they'll associate it with the app and think they're getting value they actually aren't.

    In the end, it's BlackBerryCool's job to educate the users about what a 3rd party app can do, and whether these claims are factual, to avoid a placebo-type effect that cheats the user out of their hard-earned money.

    There are so many apps out there that provide real value for money. Let's focus on those.