Wireshark-dev: Re: [Wireshark-dev] [Wireshark-bugs] [Bug 9114] Memory not released when startin

From: Joerg Mayer <jmayer@xxxxxxxxx>
Date: Fri, 20 Sep 2013 22:40:59 +0200
I'd like to discuss the consequences of the remark below in a bit more depth:

On Fri, Sep 20, 2013 at 08:27:47PM +0000, bugzilla-daemon@xxxxxxxxxxxxx wrote:
> https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9114
...
> --- Comment #1 from Jeff Morriss <jeff.morriss.ws@xxxxxxxxx> ---
> Wireshark intentionally does not free all the memory it had allocated when
> closing a capture file.  It uses its own memory allocator which allows it to
> keep (rather large) blocks of memory around for later re-use (when that happens
> the memory allocator marks all the memory as "freed" but you won't be able to
> see that from any OS utilities: they will simply report Wireshark has still
> having allocated however much memory).  Not freeing that memory is an
> optimization to avoid having to re-allocate that memory again when the next
> file is read.

It this really the right strategy? If I open a huge capture file (with huge
allocations) and then open a small file, the (virtual) memory will still be gone.
How big is the performance win of not freeing/allocating in real operation?

thanks
   Jörg

-- 
Joerg Mayer                                           <jmayer@xxxxxxxxx>
We are stuck with technology when what we really want is just stuff that
works. Some say that should read Microsoft instead of technology.