httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <>
Subject Re: SYSV Shared Memory (Was: Re: vote status)
Date Sun, 18 Feb 1996 20:28:05 GMT
Robert S. Thau wrote:
>   My crude solution at the time was to malloc(1000000), then shmat(), then
>   free(). Not all that suitable really.
> [Catching up on old email...]
> Hmmm... most malloc()s I have experience with will *not* return freed
> space to the system pool, meaning that if you malloc() a megabyte, and
> then subsequently free it, that process (and all of its descendants)
> will have a data segment of at least a megabyte in size forevermore.
> Obviously, if thirty or forty copies of the thing are going to be
> running simultaneously, this is not good.
> A sequence along the lines of sbrk/shmat/sbrk-back might be a better
> fit... that at least has a *chance* of returning the reserved space
> back to the system.

That's an idea... The actual size to increase can be a "best guess",
which can be OS-tuned (i.e. if the OS "section" in conf.h doesn't have
MOVEBRK defined, it uses a default value). We'll also need to remember to
remove the segment (not just detach it) when we would "delete" the score-
board file... Or else use a common key :/

I know this hack will be ugly, but even so, I'm sure some systems
would perform better with this rather than a scoreboard file...
Jim Jagielski  << >>   |      "That's a Smith & Wesson,
  **  jaguNET Access Services  **      |       and you've had your six" 
      Email:          |             - James Bond
++         +++      Voice/Fax: 410-931-7060       ++

View raw message