pyahocorasick icon indicating copy to clipboard operation
pyahocorasick copied to clipboard

memory leak for python2

Open wangye360 opened this issue 4 years ago • 6 comments

demo code:


import os import psutil import ahocorasick

def build_automaton(): automation = ahocorasick.Automaton() for i in range(2000000): automation.exists(str(i))

def show_used_memory(): print('memory used: {} M'.format(psutil.Process(os.getpid()).memory_info().rss / (1024. ** 2)))

if name == 'main': build_automaton() show_used_memory()

build_automaton()
show_used_memory()

build_automaton()
show_used_memory()

for python2, result: memory used: 162.6875 M memory used: 255.78125 M memory used: 348.8828125 M

for python3, result: memory used: 10.23046875 M memory used: 10.26171875 M memory used: 10.26171875 M

thanks!

wangye360 avatar Sep 18 '19 07:09 wangye360

Thank you for the report.

WojciechMula avatar Oct 28 '19 18:10 WojciechMula

any plans to fix this?

eddy-avanan avatar Dec 18 '19 13:12 eddy-avanan

i have the same problem.

stemon avatar Dec 31 '19 07:12 stemon

@eddy-avanan Not at that moment, but I'll try to look at this issue. It seems to be a regression, as we already had similar problem and it was solved.

WojciechMula avatar Dec 31 '19 16:12 WojciechMula

Any updates on memory leak issue for python 2?

galanamanj avatar Dec 21 '21 05:12 galanamanj

@galanamanj could you try to run the tests listed in the release-checklist.txt file on your Python 2 installation? In particular the valgrind tests.

Actual help to track (and fix) these would be mucho welcomed!

pombredanne avatar Feb 20 '22 11:02 pombredanne

I am closing for lack of activity. Please reopen if you feel strongly about it, though Python 2 really fell out of fashion these days ;)

pombredanne avatar Jan 14 '23 16:01 pombredanne