When running attached python script, the memory usage is steadily increasing. Culprit is the get_point_map() command. How can I clear the memory every iteration?
The allocated memory areas for the point clouds (pcloud variable in the Python script) will be freed eventually by the garbage collector. That is what I observed on my machine. Can you confirm this?
In Python you cannot really deallocate the memory yourself. You could call del pcloud, but this will still leave it to the garbage collector to free the unreachable object somewhere in the future.
You can, however, invoke a garbage collection manually by running:
On my machine memory usage seems to be running up continuously with the process taking up ofter 6Gb after 150 iterations.
With manual garbage collect however, the memory usage stays low, so this seems to solve it.