Full error message: "Not enough Memory to get Image: bitmap exceeds VM budged"
How to reproduce: Open Kitchen Sink and goto Phone/Photo Gallery
If you load a large image (say 3mpix) into the imageview, it is working fine. If you try to do that a second time, the above stated error appears.
That seems like some deallocate issue. Even if the window is closed (win.close()), the problem remains.
I thought that if the window is closed, all allocated memory to that window will be freed. That is obviously not the case.
Any hints on this are appreciated =)
I have just unwound that error. It happens because it cant generate the event object (it lacks memory), so in my case it just doesnt call any callback function, and doesnt even give me an error.
To be able to do select the image from the gallery the second time I used a workaround: assigned the imageview to the small 1 pixel local image. Then the old huge image was gone, memory freed, the new image could come in.
We'll look into it again. Believe it or not, we've been trying to figure out how to force free images for a long time. The memory for the image is actually allocated outside the JVM so you don't know that you're out of memory until the exception is thrown.
Think you can help? Login to answer this question!