Backport PR #45489 on branch 1.4.x (Bug tojson memleak)
Backport PR #45489: Bug tojson memleak
cancel workflow not responding. i'll merge since will be waiting for ci to complete on 1.4.x and performing other checks before starting release.