This stems from an issue I posted in the android-ndk group, but I
found recently that that's not really where the problem stems from.
Basically, I'm writing a game, for which I store all my
assets(textures, 3d models, level maps, etc) as raw resources(which I
load through my Activity into byte arrays which are then passed to the
ndk for processing). However, after 7 times of loading the activity,
it would crash saying either "Out of Memory" or "Bitmap exceeds VM
budget". After a bunch of work paring down what the issue could be, I
found that if I only load each byte array once, into static arrays,
the problem no longer occurs.

Clearly a memory leak is occurring here and I have reason to believe
that it's not in my actual storage of the byte arrays since even if
the arrays are made non-static, setting them to null and then
reloading them results in the same crash after 7 runs. I've tried
closing the input stream after each resource is loaded, but that
didn't help either. I'm wondering if there's a reason why reading raw
resources this way leaks memory and also if there's a way to stop this
from occurring.

Thanks for any help.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to