I've faced with a leaking memory in asynchronous one of my applications. I've installed aiomonitor package which allows me to investigate an issue without interrupting the main thread (like gdb does).
But objgraph package functions do not show any output. This is because sys.stdout in the main thread is the whole application output, not the current console. But aiomonitor handles print function calls and shows the result into the current console instead of whole application log.
So I've changed the way objgraph is showing the output - instead of using print(file=sys.stdout) or sys.stdout.write just the plain print function is used.
But feature of redirecting the output into a file or other stream is still working just as expected.
Hi.
I've faced with a leaking memory in asynchronous one of my applications. I've installed aiomonitor package which allows me to investigate an issue without interrupting the main thread (like gdb does).
But objgraph package functions do not show any output. This is because sys.stdout in the main thread is the whole application output, not the current console. But aiomonitor handles
print
function calls and shows the result into the current console instead of whole application log.So I've changed the way objgraph is showing the output - instead of using
print(file=sys.stdout)
orsys.stdout.write
just the plainprint
function is used. But feature of redirecting the output into a file or other stream is still working just as expected.