Skip to content
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

Out of memory exception with using multiple high resolution textures #29

Open
ParagRKadam opened this issue Jul 12, 2016 · 0 comments
Open

Comments

@ParagRKadam
Copy link

This is the error that I am getting when I use multiple(~30 images) high resolution(4096 X 2048) textures with each image being around 5 MB on Nexus 5 android version 4.4.4.
E/Adreno-GSL﹕ <ioctl_kgsl_sharedmem_alloc:1532>: ioctl_kgsl_sharedmem_alloc: FATAL ERROR : (null)

I have several Images stored in my android app locally in the drawable-nodpi folder. And I change the texture of my sphere very often by calling the following function in VR app:-

public void changeImage(int imageResourceId) {

    Texture t = new Texture("sphereTexture", imageResourceId);
    t.shouldRecycle(true);
    ArrayList<Object3D> objectList = getCurrentScene().getChildrenCopy(); // Get reference to sphere

    Material material = objectList.get(0).getMaterial(); // get material of sphere
    for (ATexture texture : material.getTextureList()) {// remove previous texture on material
        material.removeTexture(texture);
        texture = null;
    }


    try {
        material.addTexture(t); // add new texture to material
    } catch (Exception e) {
        e.printStackTrace();
    }
}

So my question is, is it possible to get rid of this error? Is there any recommendation for using image textures like what is the right resolution for image textures etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant