Hello!
I’m working on an application that loads a user-selectable very many models of up to 20 MB. Once downloaded other one model is removed. To clear the memory I use the following code.
private function removeObject(data:ObjectContainer3D):void {
for (var i:int = 0; i < data.numChildren; i++) {
var mesh:Mesh = Mesh(data.getChildAt(i));
if (mesh.material is TextureMaterial) TextureMaterial(mesh.material).texture.dispose();
mesh.geometry.dispose();
}
object3d.removeChild(data);
}
The problem is that the memory is cleared very slowly. If I quickly remove the objects and load the new, an error number 3691.
Error #3691: Resource limit for this resource type exceeded
at away3d.textures::Texture2DBase/createTexture() at away3d.textures::TextureProxyBase/getTextureForStage3D()
at away3d.materials.methods::BasicDiffuseMethod/activate()
at away3d.materials.passes::CompiledPass/activate()
at away3d.materials.passes::SuperShaderPass/activate()
at away3d.materials::MaterialBase/activatePass()
at away3d.core.render::DefaultRenderer/drawRenderables()
at away3d.core.render::DefaultRenderer/draw()
at away3d.core.render::RendererBase/executeRender()
at away3d.core.render::DefaultRenderer/executeRender()
at away3d.core.render::RendererBase/render()
at away3d.containers::View3D/render()
Tell me how possible speed up the cleanup?