04-25-2013 06:21 PM
How much memory is my application allowed to use while it's backgrounding? My app is fairly frequently killed when it receives a device memory low, level 2, signal (while it is in the background). This is while my app is using about 20M memory.
I'm assuming at some point the OS won't kill my app because the memory it's using is negligable, or within some allowed amount? Anyone know that point? I can see that other apps on the device aren't killed when the low memory signals are thrown.
04-25-2013 08:10 PM
04-25-2013 08:18 PM
Weird, I wonder why my app is being killed, then. It always happens right after a high priority memory warning while its in the background.
Usually if I run the app, background it, then open blackberry world, the browser, and one other app, it will get the memory warning and die.
I sometimes get warnings while its in the foreground too, but the OS never seems to act upon them while i'm foregrounding (ie, my app is never killed).
04-26-2013 09:40 AM
04-26-2013 09:46 AM
are you using a Z10 or a DevAlpha A/B ?
DevAlpha A/B only have 1 GB so you cannot compare them with real devices in respect of memory
04-27-2013 02:28 AM - edited 04-27-2013 02:28 AM
The problem is present on both the Dev Alpha B and C, I don't have a Z10 to test on.
My app does request (and make use of) running in the background to periodically check for updates. These updates don't really use much memory, though, and have a negligible effect on the amount of memory the app uses (it effectively uses the same amount of memory while running in the background doing nothing as it does while running in the background querying for updates).
The Z10 has more memory, but I'm not sure if that would change the behavior I'm seeing? Certainly the user would probably have to open more apps to get the device low on memory, but I'm assuming I'd still receive memory warnings and be killed when the device was low on memory?
I guess if the Z10 never runs into memory warnings with 8 apps open, then this is more or less a non-issue, but I definitely don't want my app dieing while it's backgrounding, since it sends 'important' notifications to the user.
04-27-2013 02:39 AM
DevAlpha C has 2 GB - so this seems not to be a 1 GB problem
perhaps you should do some more profiling and tests and open an issue.
If a Device runs into low memory, then it seems valid (for me) to kill the oldest opened minimized app by OS.
what else could be the solution ?
if you're running important thinngs you have to test for low memory and send a notification to the Hub or so to inform the user that he/she has to close one or more apps to avoid that your app will be killed
for important background operations you have to wait for Services running in the background -
there will be some info on this at BBJam in Orlando.