The attached reproducers link-leak.c and link-leak.py open and close links repeatedly on the same connection. This causes the routers memory use to grow.
Massif shows that the memory is due to pn_link_t and related objects.
PROTON-905 describes an old bug where link information is leaked but experiments show this is not happening with modern proton.
I suspect the growth is due to dispatch sometimes failing to call pn_link_free() but investigation is still ongoing.