Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using .update has a memory leak #44

Open
pashashocky opened this issue Mar 13, 2020 · 0 comments
Open

Using .update has a memory leak #44

pashashocky opened this issue Mar 13, 2020 · 0 comments

Comments

@pashashocky
Copy link

Description

Using .update method of a bounter counter with anothe counter has a memory leak.

Steps/Code/Corpus to Reproduce

printing would be useful, but here's the idea

def mem_leak():
    get_mem()
    c1 = bounter.bounter()
    c2 = bounter.bounter()
    for i in range(10**7):
        c1[random.randint(0,10)] += 1
        c2[random.randint(0,10)] += 1
    get_mem()
    c1.update(c2)
    get_mem()

def get_mem():
    print(psutils.Process(os.getpid()).memory_full_info().rss / 2 ** 20)  # in mb

get_mem()
mem_leak()
get_mem()
mem_leak()
get_mem()

Expected Results

Expect counters c1 and c2 to completely be destroyed from memory after mem_leak function exits.

Actual Results

Some memory remains used even after mem_leak function exits.

Versions

can't run versions, but:
Linux 4.14 amzn linux x86
Python 3.6.6
Numpy 1.16.4
pandas 0.24.2
bounter 1.1.0

@mpenkov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant