I have a function that generates a huge object (about 100-150Gb of memory, on a machine having 500Gb memory).
The function runs in about 1h, and writes a file to disk (about 100Mb).
But when the function ends, the program hangs there for several hours without doing anything (it doesn't continue instructions after the place where the function was called).
I suspect the garbage collector trying to delete the huge object created in this function, but I don't see anything happening (strace prints nothing), and the memory is not decreasing.
Do you have any idea of why this is happening and how to solve it ? I'm using python 3.5