Start a new topic

Persistent "Texture memory exceeded" error

Persistent "Texture memory exceeded" error


Hello,

I'm currently trying to create an AR environment with several layers of POIs. Each POI has a marker which uses the drawables:


The 'idle' marker base

The 'selected' marker base

The direction indicator

One label

One icon (which indicates which layer it belongs to)

The radar indicator


There is a Preferences screen where users check the layers they want to display. I then attempt to unload all loaded POIs by using the following code (this is adapted from a thread on this forum):

reloadAllMarkersJs: function reloadAllMarkersFn() {

 

        var tmp = World.markerList.length - 1;

        while( World.markerList.length>0 ){

 

        // Deleting cam elements (label and image)

        World.markerList.markerObject.drawables.removeCamDrawable(0);

        World.markerList.markerObject.drawables.removeCamDrawable(0);

        World.markerList.markerObject.drawables.removeCamDrawable(0);

 

        // Deleting indicator elements

        World.markerList.markerObject.drawables.removeIndicatorDrawable(0);

 

        // Deleting element from radar

        World.markerList.markerObject.drawables.removeRadarDrawable(0);

 

        World.markerList.descriptionLabel.destroy();

        World.markerList.markerDrawable_idle.destroy();

        World.markerList.markerDrawable_selected.destroy();

 

        if (World.markerList.markerDrawable_iconAccessPoint != null) {

            World.markerList.markerDrawable_iconAccessPoint.destroy();

        };

        if (World.markerList.markerDrawable_iconPoints != null) {

            World.markerList.markerDrawable_iconPoints.destroy();

        };

        if (World.markerList.markerDrawable_iconSignal != null) {

            World.markerList.markerDrawable_iconSignal.destroy();

        };

        if (World.markerList.markerDrawable_iconStation != null) {

            World.markerList.markerDrawable_iconStation.destroy();

        };

        if (World.markerList.markerDrawable_iconMilepost != null) {

            World.markerList.markerDrawable_iconMilepost.destroy();

        };

        if (World.markerList.markerDrawable_iconLevelCrossing != null) {

            World.markerList.markerDrawable_iconLevelCrossing.destroy();

        };

 

        World.markerList.markerObject = null;

        World.markerList.pop();

 

        tmp = tmp - 1;

        }

 

However, it seems that all of the POI drawables may not be unloading correctly as, after changing the settings a few times, LogCat invariably starts flooding out "Texture Memory Exceeded" errors.

Can you offer any advice about how to make sure every drawable is unloaded from the marker before the marker is removed from the list? Can you point me in the direction of any resources about texture memory debugging? We're developing a demo for this app before we purchase any SDK but it will eventually be a commercial project available for Android and Google Glass. So obviously if we cannot get this issue sorted with Wikitude we will unfortunately have to take our business to Junaio or similar before we actually make a purchase.

Hello,

I've downloaded the new SDK version (3.3) this morning and it seems that this problem has been resolved with that update.

Hi,
We have a sample included in the sample application, which demonstrates how to destroy objects correctly before loading a new set of pois. It's sample 5-4 'Reloading Content'.

In general you should keep in mind that the texture memory we use is limitted so don't use images that are to large (in pixel size) and destroy them whenever you don't need them anymore.

There will be a huge improvement in the way we handle textures internally but currently I can't give you any specific date. However, there will be a 'nightly build' available from now on every two weeks where we integrate the latest changes.

Best regards

Andreas
Login or Signup to post a comment