0

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?

Jetdr
  • 39
  • 2
  • check this link out... Might help
    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
  • How to remove them? That depends on how you create and store them. Show us your relevant code! – Klaus D. Aug 27 '21 at 12:35

0 Answers0