[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: IRC-Problem
On Tue, Apr 04, 2000 at 10:21:16PM -0400, Christophe Kalt wrote:
> On Apr 03, Kurt Roeckx wrote:
> |
> | "Buffer allocation error for %s" is generated when valloc (malloc) returns
> | NULL. This means that either you're out of ram, or malloc doesn't know how
> | to alloc more. You should probably check your OS's manual.
>
> actually, this isn't quite true.
> it is returned when the server runs out of dbufs.
>
> dbufs are pre-allocated on startup and allocation of
> additional dbufs is only rarely allowed.
[...]
> 2/ the decision to allow the allocation of more dbufs is
> based on a few assumptions, (all?) most of which are more
> or less wrong.
I just looked at it again, and now see it. I thought that if freelist was
NULL, it would always increase it, but it does:
if (istat.is_dbufuse * DBUFSIZ > poolsize), which is probably the correct
way to do it. But it's only done when a server is sending, and it's in
burst mode.
Additionally some of those dbuf's could be as good empty, and therefor
not "used", so not on the freelist yet. It could be that it's only really
using a small part of what's allocated. I think this will be a big problem
when you have alot "busy" clients on the same channel, so that you need to
write the same data to alot clients.
I don't think always allocating when freelist is empty is the correct
thing to do. I guess the algoritmes needs to be changed so that a
partially freed buffers gets reused faster.
I'll see if I can come up with something.
Q