-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OutOfMemoryException #28
Comments
Hm normally the resizeBitmapIfNecessary is needed if the textures do not have a size with power of two so e.g. 256x128, so just leaving this method call away might cause crashes on some devices which can only handle such textures (actually I thought all devices can only handle such textures). Maybe you try to call a manual garbage collect after you loaded each image instead? but normally loading 5 images should not be a problem at all, only if you have very big images |
-Maybe you try to call a manual garbage collect after you loaded each image instead? -but normally loading 5 images should not be a problem at all, only if you have very big image. |
wath resolution are these images? did you enable the large heap flag in your android manifest? that could help. |
It seems like this large heap flag helped a lot thx. |
That this flag helped also indicates that you are using to big images ;-)
|
Well the images come from the camera folder ,so the purpose of the app is to handle all images that have been taken using the phones camera. |
I am playing around with your awesome lib and i came across this error.
OutOfMemory Exception ( I will try to add some logs )
What i am doing is that i get 5 icons from the camera folder and i pass them from the MainActivity to the Setup class as bitmaps.
After that i use this code to create MeshComponents
MeshComponent imageMesh = GLFactory.getInstance().newTexturedSquare(
"icon" + scounter, bitmap);
I get this error when trying to load the second image.
I have overcame this error by commenting out that line
texture = TextureManager.getInstance().resizeBitmapIfNecessary(texture);
which is at gl.textures.textureShape. textureShape constructor.
It seems to me that it always tries to recreate the bitmap resulting in OutOfMemory error.
The text was updated successfully, but these errors were encountered: