Wireshark-dev: Re: [Wireshark-dev] [Bug 7775] Wireshark leaks memory when selecting packets
From: Jakub Zawadzki <darkjames-ws@xxxxxxxxxxxx>
Date: Mon, 8 Oct 2012 21:31:50 +0200
Hi Evan,

On Mon, Oct 08, 2012 at 03:06:29PM -0400, Evan Huus wrote:
> On Mon, Oct 8, 2012 at 2:58 PM,  <bugzilla-daemon@xxxxxxxxxxxxx> wrote:
> > https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7775
> >
> > --- Comment #10 from Anatoly <aries.nah@xxxxxxxxx> 2012-10-08 14:58:26 EDT ---
> > I've tried r45395, nothin is changed except wireshark has crashed:)
> > But I got one more probably interesting fact: r45380 (w/o your fixes) on Vista
> > 32 bit - memory consumption increases slightly and sometimes it decreases, but
> > the same revision of XP 32bit - it always increases by ~2MB.
> 
> This appears to be an XP-specific bug if anyone still has an XP
> install to test with (I don't).

It mighe be OOM, for every packet we mmap 10MiB chunk of memory.
Which is *not* unmaped in emem_free_all() nor ep_free_pool().
(AFAIR for performance reasons)

Generally it'd be best to save somewhere mem->free_list before
1333         g_free(mem);

If it's hard to do than emem_destroy_chunk() is your friend.

[PS: I haven't test it yet, but looking at diff it makes sense, 
     if not please move on ;)]

Cheers,
 Kuba.