From: Russ Cox <rsc@swtch.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] aux/acidleak pool pathology
Date: Thu, 21 May 2009 09:35:01 -0700 [thread overview]
Message-ID: <dd6fe68a0905210935x16effa53o403c9eff67defabc@mail.gmail.com> (raw)
In-Reply-To: <3d5d84f983b9566c6c007392f3c55ed4@quanstro.net>
> obviously the Brdline loop in main is reallocating data and block
> so they don't fit in their previous buckets and pool sbrk's more
> memory. it would seem that pool is missing the fact that
It's probably a combination of data and block growing together
along with the occasional estrdup that is causing the fragmentation.
You should rewrite both of the reallocs to double the array when
they outgrow the current one instead of growing by a fixed amount.
The fixed amount is nice because it avoids the extra variable
tracking the maximum size of the array, but it's a terrible algorithm.
Russ
next prev parent reply other threads:[~2009-05-21 16:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-21 16:06 erik quanstrom
2009-05-21 16:35 ` Russ Cox [this message]
2009-05-21 16:54 ` erik quanstrom
2009-05-21 16:57 ` erik quanstrom
2009-05-21 17:19 ` Russ Cox
2009-05-21 18:04 ` erik quanstrom
2009-05-21 18:49 ` Russ Cox
2009-05-22 2:13 ` erik quanstrom
2009-05-22 16:52 ` Joel C. Salomon
2009-05-22 17:13 ` erik quanstrom
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=dd6fe68a0905210935x16effa53o403c9eff67defabc@mail.gmail.com \
--to=rsc@swtch.com \
--cc=9fans@9fans.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).