When a struct has a map member, fastbinary.binary_encode leaks memory.
Use testmem.tar.gz app to recreate the problem.
As this is running, use top or pidstat to view the memory consumed by the process. Hit CTRL-C to stop. On my system it steadily increases.
To compare the results using the 'default' encoding technique (using pure Python TBinaryProtocol), run testmem as follows:
Note (again, using top, pidstat, etc.) that the memory used is constant.
It appears that the 'map' member triggers this. E.g. string, int members do not cause the leak.