I wrote a chess engine in python and it eats up 13GB of RAM really quickly. I decreased the scale of the engine and used the objgraph library to check the size of data-structures created by the program.
This is what is shown:
Move 1527385
list 127783
function 95591
dict 86559
tuple 48816
Node 22701
Action 22648
Board 21059
I know that there are too many board objects created by the algorithm, but how do I remove these objects from the memory? I have tried using Python's garbage collector library, using the del function to manually remove instances of the move in my program, but the number of instances does not seem to decrease.
How can I remove these instances from my memory?
https://stackoverflow.com/questions/26545051/is-there-a-way-to-delete-created-variables-functions-etc-from-the-memory-of-th – Franky Pinto Aug 27 '21 at 12:26