Re: IPC/Shared memory automatic freeing ?

Keith Owens (kaos@ocs.com.au)
Tue, 16 Mar 1999 17:09:13 -0800


On Wed, 17 Mar 1999 01:29:54 +0100 (CET),
Eric Estievenart <eric@via.ecp.fr> wrote:
>Working and debugging a small proggy using IPC shared memory
>with some friends, we had some memory segments not freed
>when it didn't finish normally.
>
>Of course, I do not propose to free the pages as soon as the
>number of attachements reaches zero (damned developpers that
>detach and exit before a child has attached hisself to the
>segment... ;), but we could reuse the resources if they are
>not attached and unused for some amount of time (using
>the shm_ctime info).

It is legal for an application to create a shared memory page once then
let other programs store data as required, with a periodic program to
copy the results to disk. If the flush program and the other programs
are not running *right now* then the use count is zero. It does not
mean that the kernel can reap the storage.

This is absolutely an application policy problem, the kernel must keep
its nose out. If an administrator really cares about this, they can
implement their own policy with a cron job that uses ipcs and ipcrm as
required for that site.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/