1. hollip3020's Avatar
    Garbage collection is only useful if it is actually invoked and the dataset is marked. Most of the time memory leak is due to lazy programming/bug checking more than the programming language. Developers don't flush all the data when you close the program causing a memory leak. Also, alot of the news apps constantly grabs new stories/data and caches it on the device.
    Java by nature runs each app in its own sandbox and apps can only use memory in their own sandbox. The JVM can always add/remove memory from an app's sandbox, but, once the app closes the entire sandbox is flushed eliminating any possibility of memory leaks, unless of course the JVM itself sucks. I guessing this is probably not the case considering RIM probably worked with Sun when they were developing their JVM.

    So i noticed my phone slowing down a lot so I checked my available memory... had to take a screenshot of this one, my previous low was around 300 kb:
    wow, that's impressive
    04-01-09 01:15 PM
  2. cvmaas's Avatar
    I hate to tell you this, but WINDOWS memory management is designed the same way as java, and yet there are still memory leaks and we still need to reboot to clear the garbage. There are always ways to get into some real global memory that will not be naturally cleaned by closing the application. The phone is the same way, otherwise none of our programs would be able to interact with each other!

    Java by nature runs each app in its own sandbox and apps can only use memory in their own sandbox. The JVM can always add/remove memory from an app's sandbox, but, once the app closes the entire sandbox is flushed eliminating any possibility of memory leaks, unless of course the JVM itself sucks. I guessing this is probably not the case considering RIM probably worked with Sun when they were developing their JVM.
    04-12-09 10:06 AM
  3. cvmaas's Avatar
    You've never programmed much at all have you? I am guessing running a debugger to look at memory usage is alien to you? Maybe you're little "Hello world" program you did in Java 101 didn't have issues collecting the garbage, but if you ever did any REAL coding, YOU wouldn't be making statements like that!

    I've coded in Basic, Visual Basic, Pascal, C, C++, Java, ASM, you name it. TRUST me, poor code will always find a way to mess things up outside of its little garbage collected playground.

    You could whip up a simple program in Java for our phones that will just sit there and write random junk to a file, and by the memory design of our devices, will look like a leak. If you don't delete that file when you close the program you just leaked your garbage into the general application space.

    Now please go take your snotty remarks back to your professor and tell him you clearly haven't learned enough.

    You've never programmed with Java have you? Or really any garbage collected language. If you had, you wouldn't be making comments like that.
    04-12-09 10:18 AM
28 12
LINK TO POST COPIED TO CLIPBOARD