Fixed by explicit closing of stdin channel in paramiko after sending the archive bytes.
channels = client.exec_command(...)
stdin = channels[0]
with open(archive_path, "rb") as pca:
while True:
block = pca.read(BLOCKSIZE)
if not block:
break
stdin.write(block)
stdin.close() ## <-- added this
It seems tar is postponing finalization of some details to end of the whole input processing, and the channel object was hanging in Python memory.