# Sprite.remove(); doesn't work -- it's left on the scene

**URL:** <https://discourse.threejs.org/t/sprite-remove-doesnt-work-its-left-on-the-scene/32352>\
**Category:** Questions\
**Tags:** memory-leak\
**Created:** [December 4, 2021, 8:14am UTC](https://discourse.threejs.org/t/sprite-remove-doesnt-work-its-left-on-the-scene/32352 "2021-12-04T08:14:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Normore](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/andrew_normore/32/5004_2.png) [@Andrew\_Normore](https://discourse.threejs.org/u/Andrew_Normore)\
**Post date:** [December 4, 2021, 8:14am UTC](https://discourse.threejs.org/t/sprite-remove-doesnt-work-its-left-on-the-scene/32352/1 "2021-12-04T08:14:22Z")

</div>

I switched over to using Sprites, but now my .remove functions are left behind and pile up, killing CPU.

How do I remove this?!

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/threejs/original/3X/e/d/ed6ae9a793306736c1bac258599c66b18be7be90.jpeg)

---

<div class="post-metadata">

**Author:** ![Andrew\_Normore](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/andrew_normore/32/5004_2.png) [@Andrew\_Normore](https://discourse.threejs.org/u/Andrew_Normore)\
**Post date:** [December 4, 2021, 8:21am UTC](https://discourse.threejs.org/t/sprite-remove-doesnt-work-its-left-on-the-scene/32352/2 "2021-12-04T08:21:19Z")

</div>

```javascript
		scene.remove(plasmaBall);
						plasmaBall.material.dispose();
						//plasmaBall.material.map.dispose(); // nope
						// plasmaBall.geometry.dispose(); // nope
						disposeHierarchy(plasmaBall);
						
						plasmaBalls = plasmaBalls.slice(0,mining_index).concat(plasmaBalls.slice(mining_index+1));
						plasmaBall = null;

```

had to set it to NULL at the end, found an old example here:

> <https://github.com/mrdoob/three.js/issues/7449>
>
> I have noticed strange memory leak in three.js (r73). Steps to reproduce:
> 
> 1)Ope…n following link in Google Chrome ( 46.0.2490.80 m)
> 
> http://threejs.org/examples/#webgl\_test\_memory
> 
> 2) Open DevTools -\> Profiles - \> Take Heap Snapshot. See my screenshot below:
> 
> !\[image\](https://cloud.githubusercontent.com/assets/12031915/10725014/ec6f2e3e-7bd9-11e5-83ef-1e8277f0f2df.png)
> 
> 3) Take another heap snapshot after 10 seconds. As you can see the size of heap increased.
> 
> !\[image\](https://cloud.githubusercontent.com/assets/12031915/10725019/fe901e0c-7bd9-11e5-8413-ba41dd9b0585.png)
> 
> But if open this page locally on the computer without any server than heap size will be within the bounds of 4-6 Mb.
> 
> !\[image\](https://cloud.githubusercontent.com/assets/12031915/10725044/22ca5896-7bda-11e5-8948-e3ab96a3dc43.png)
> 
> Why used memory size permanently increased in example and constant in case of locally page opening?
> 
> Thanks in advance!
> 
> Best regards, Vasily.
