Closed marcoffee closed 1 year ago
This pull request addresses the issue #57. Note that, the bug reported happens for any bufferable object, except for bytes, which are handled separately on the code.
bytes
Test code:
import pyhash import psutil import numpy as np hasher = pyhash.highway_128() memory_before = psutil.Process().memory_info().rss for _ in range(10): hasher(np.random.randint(0, 255, 2 ** 30, np.uint8)) memory_after = psutil.Process().memory_info().rss print("memory increase =", memory_after - memory_before)
current version: memory increase = 10737897472 after correction: memory increase = 593920 (probably some objects waiting for garbage collection)
memory increase = 10737897472
memory increase = 593920
Thanks
This pull request addresses the issue #57. Note that, the bug reported happens for any bufferable object, except for
bytes
, which are handled separately on the code.Test code:
current version:
memory increase = 10737897472
after correction:memory increase = 593920
(probably some objects waiting for garbage collection)