I am currently having problems freeing up memory in a ThreeJS application.
I know that there are several questions on this issue:
I do delete the objects using the following Typescript function I did:
function dispose( object3D: THREE.Object3D ): void
{
for ( let childIndex = 0; childIndex < object3D.children.length; ++childIndex )
{
this.dispose( object3D.children[childIndex] );
}
object3D.children = [];
if ( object3D instanceof THREE.Mesh )
{
object3D.geometry.dispose();
if ( object3D.material instanceof THREE.MultiMaterial )
{
for ( let matIndex = 0; matIndex < object3D.material.materials.length; ++matIndex )
{
object3D.material.materials[matIndex].dispose();
object3D.material.materials[matIndex] = null;
}
object3D.material.materials = [];
}
if ( object3D.material.dispose )
{
object3D.material.dispose();
object3D.material = null;
}
}
if ( object3D.parent )
object3D.parent.remove( object3D );
object3D = null;
}
However, when I take a bunch of pictures using Chrome Dev tools, I still have tons and tons:
- Arrays
- Vector2 (uvs in
__directGeometry, ...) - Vector3 (vertices in
geometry, normal in faces, vertex in colors in faces, ...) - Face3 (face in
geometry) - Color (colors in
__directGeometry, ...) - JSArrayBufferData (, ,
attributes geometry,...)
- Jetsam iOS, .: Jetsam WebGL iOS
, , .