views:

47

answers:

1

Hi there,

I am developing a simple app which does a little bit of image-processing. It's divided in two activities; the main one with some display elements and the second one which is used to capture images off the phone's camera. To discribe my problem: I start the app, capture an image (by starting a new Intent with the subactivity) and all data is displayed correctly. If I capture another image after this, I run in an

java.lang.OutOfMemoryError - bitmap size exceeds VM budget

I dont store the captured bitmap, in the second activity I just extract some data from it and pass it to the main-activity; finishing (finish()) the sub-activity afterwards. I really dont know what I can do about it. Thanks in advance!

greetings, Zacherl

PS: It is my first approach to android, so I apologize for any stupid beginner error I did; if someone needs any further information, I would be happy to provide it.

A: 

You might want to check this thread: http://stackoverflow.com/questions/2131947/android-memory-allocation

You don't get a lot of memory to work with so you might very well not have enough to load 2 large camera images into memory with everything else.

Dave
Thank you for the quick answer! The point is, that I cant scale down the image because then I would lose most of the contained data.To be more precisely: I store the complete image temporarily within an boolean-array which I use to extract the data and after that step, I return the data (a HashSet with ten to fourty primitive values). I don't think that the HashSet consumes that much space so I fear the VM's GC does not free the space used by the boolean array after the method is finished.Did I explain myself?
Zacherl