like writing inefficient routines, not removing pointers when done using them, etc.
like if i write a program it and stores data in variables, and lets say the idea is to have this variable wiped out before i write new data to it. but lets say one of my subroutines was wrong, and i forgot to wipe the variable before i added data to it. so instead i am appending the data to the variable. over time this variable grows and grows and grows. and in turn sucks up lots of memory.
The Java Virtual Machine is supposed to do its own memory management, removing memory structures once they're no longer in use -- "garbage collection", they call it. Unfortunately, if an app isn't written right, it won't release that memory for cleanup. And since (I'm pretty sure) the JVM never actually unloads a module once it's been installed, it just kind of sits there in memory, slowly swelling.
Unfortunate downside of a Java-based platform -- It's a complete pig.
Posted from my CrackBerry at wapforums.crackberry.com
The Java Virtual Machine is supposed to do its own memory management, removing memory structures once they're no longer in use -- "garbage collection", they call it. Unfortunately, if an app isn't written right, it won't release that memory for cleanup. And since (I'm pretty sure) the JVM never actually unloads a module once it's been installed, it just kind of sits there in memory, slowly swelling.
Unfortunate downside of a Java-based platform -- It's a complete pig.
Posted from my CrackBerry at wapforums.crackberry.com
I think your description is close, but JVM is supposed to release program modules when they are redundant. That's where another problem appears because the routine is not dead until it has destroyed all the memory storage it created. This means simply forgetting to release a single byte variable can block the release of the whole module. This can be compounded some more when the top level parent app is closed and the rogue module gets orphaned. Next time the app is launched it gets a new process handle, it can't retrieve the orphan module so it loads a new instance and the cycle repeats.
Posted from my CrackBerry at wapforums.crackberry.com
All that has been said are contributing factors, but the main reason of memory leak is due to infinite loops within the JVM. But it's even more so due to the code not being truly as solid as it could be. That said, the leak is being addressed some with each build, and when the SW reaches a certain point of stability, the leak will be focused on more squarely, and all but fixed.