GPU memory leak, Texture(M)

Here is a link to a topic in which I was having the same issue.

The link in the topic is outdated to the solution but here it is

    private void clearTerrainLod() {
    
        SceneGraphVisitor sgv = new SceneGraphVisitor() {
            
            public void visit(Spatial spatial) {
            
                if (spatial instanceof Terrain) {
                    
                    TerrainLodControl tlc = spatial.getControl(TerrainLodControl.class);
                    Field f;
                    
                    try {
                        f = tlc.getClass().getDeclaredField("executor");
                        f.setAccessible(true);
                        ExecutorService ex = (ExecutorService) f.get(tlc);
                        ex.shutdown();
                    }
                    
                    catch (NoSuchFieldException nsf) {
                    }
                    
                    catch (IllegalAccessException e) {
                    }
                    
                    catch (Exception a) {
                    
                    }
            
                }
            }
        
        };
        
        app.getRootNode().depthFirstTraversal(sgv);
        
    }

Basically uses reflection to set it to accessible and then shuts down the thread directly.

Good luck.

There’s a method in TerrainLodControl called detachAndCleanUpControl() which does exactly what the above does. Also you can set your own executor with TerrainLodControl.setExecutor() and handle it yourself, which is probably what you should be doing if your application has other background tasks besides terrain updates.

The TerrainLodControl.setExecutor() does not exist, i presume i have to copy and remake the whole classe to make one? Or is it part of the nightly build?
Same thing for the detachAndCleanUpControl().

Looks like those two methods were added in 3.1 … Sorry about that.

It s alright but i can’t find a way to update my IDE to the nightly build, it just doesnt pop up the update when i check the nightly build update. If you know how i can upgrade i would do this immediatly!

Sorry … the nighties are not available at the moment. You can keep track of the progress here: