Skip to content

Possible memory leak in Arena code #1

@GoogleCodeExporter

Description

@GoogleCodeExporter
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 <jonathan.leffler@gmail.com> 

Original issue reported on code.google.com by drhan...@gmail.com on 29 Sep 2008 at 7:50

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions