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

Possible memory leak in Arena code #1

Open
GoogleCodeExporter opened this issue Mar 23, 2015 · 1 comment
Open

Possible memory leak in Arena code #1

GoogleCodeExporter opened this issue Mar 23, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

I think there's a memory leak in the Arena code.

Consider a scenario where:
* You create and release 3 arenas, each with a chunk of say 20KB of memory.
* You create a new arena, using one of those chunks; there are 2 chunks
left on the free list.
* You attempt to allocate a chunk of size 100KB.

If I read the code correctly, the loop in Arena_alloc() - p94 of the third
printing - invokes <get a new chunk 95>. Each time that is called, it
removes a chunk from the freelist, finds that it is not big enough, and
discards it, rather than restoring it to the freelist or releasing it.
-- 
Jonathan Leffler <[email protected]> 

Original issue reported on code.google.com by [email protected] on 29 Sep 2008 at 7:50

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

No branches or pull requests

1 participant