msgpack-python icon indicating copy to clipboard operation
msgpack-python copied to clipboard

memory leak observed in python 3.12.1

Open TheRealMcoy opened this issue 5 months ago • 0 comments

This library appears to leak memory in Unpacker method under Python 3.12.1

reproducer script:

import msgpack
from io import BytesIO

while True:

   buf = BytesIO()
   for i in range(100):
      buf.write(msgpack.packb(i, use_bin_type=True))

   buf.seek(0)

   unpacker = msgpack.Unpacker(buf, raw=False)
   for unpacked in unpacker:
       print(unpacked)

Python 3.11.7 after 10 minute run: python3 11

Python 3.12.1 after 10 minute run: python3 12

TheRealMcoy avatar Feb 02 '24 21:02 TheRealMcoy