# PYTHON : Cache memory management

**URL:** <https://forums.unrealengine.com/t/python-cache-memory-management/156419>\
**Category:** Editor Scripting\
**Tags:** unreal-engine\
**Created:** [January 16, 2021, 12:34am UTC](https://forums.unrealengine.com/t/python-cache-memory-management/156419 "2021-01-16T00:34:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![RobJinn](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/robjinn/32/715780_2.png) [@RobJinn](https://forums.unrealengine.com/u/RobJinn)\
**Post date:** [January 16, 2021, 12:34am UTC](https://forums.unrealengine.com/t/python-cache-memory-management/156419/1 "2021-01-16T00:34:54Z")

</div>

Hi everybody.

I have a question regarding python in unreal.  
I am testing the limits of a spawn actor tool from a json file and I using the “unreal.EditorLevelLibrary.spawn\_actor\_from\_object” function in for loop to spawn my objects.  
However I realized one thing, when I run my script for 1000 objects the ram loads at 32% and does not go down afterwards, if I run the script again at 1000 the ram remains at 32% it does not increase more but does not go down either, on the other hand if I go to 1500 or more it increases then stagnates until a new increase …  
My question is do you know why? and is there a function in unreal or python to flush the cache?

I tried to reset my variables with “myVar = None” but it had no effect

Thank you in advance.  
Robjin

---

<div class="post-metadata">

**Author:** ![user\_c01614db31f47acdd589b054cc0c4677265affd9c397ea616e4e5d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@user\_c01614db31f47acdd589b054cc0c4677265affd9c397ea616e4e5d](https://forums.unrealengine.com/u/user_c01614db31f47acdd589b054cc0c4677265affd9c397ea616e4e5d)\
**Post date:** [August 9, 2023, 2:58am UTC](https://forums.unrealengine.com/t/python-cache-memory-management/156419/2 "2023-08-09T02:58:01Z")

</div>

same question. have you solved the question?  
I get the animation curve info, because the animation asset is very big, and i run out of my memory
