This simple loop:
for i in range(100):
will have python use more and more memory. While this is not technically a memory leak, it becomes one in practice, if I want to create a large number of figure objects. How can I free the memory used by one or all figure objects?