Skip to content

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

Description

@ParagRKadam

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions