Re: polipo memory growing apparently without bound; atoms?

Josh Triplett <[email protected]>
Newsgroups gmane.comp.web.polipo.user
Message-ID <20091019225237.GA13573@feather>
On Mon, Oct 19, 2009 at 05:45:19PM +0200, Juliusz Chroboczek wrote:
> > Discarded all objects, 1 + 3 objects left (5 chunks and 351679 atoms used).
> 
> Yep, that's not good.
> 
> In gdb, you can have a look at the contents of atoms by examining
> 
>   atomHashTable[n]->string
>   atomHashTable[n]->next->string
>   atomHashTable[n]->next->next->string
>   ...
> 
> for values of n between 0 and ATOM_HASH_TABLE_SIZE.  The contents of the
> atoms will give us an idea of where these atoms come from.

We built polipo with debug symbols and started running that on our
server, so we could investigate.  We produced the following gdb script,
runnable with "gdb -batch -x thescript -p `pidof polipo`", which dumps
the contents of the atom cache.  We saved a copy of the atom cache now,
and we'll check again after polipo grows huge again.

set $i = 0
while ($i < 1024)
    set $p = atomHashTable[$i]
    while ($p)
        printf "%u of ", $p->refcount
        x/s $p->string
        set $p = $p->next
    end
    set $i = $i+1
end

Thanks,
Josh Triplett and Jamey Sharp

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.