Re: Removing an executable while it runs

Brian Gerst (bgerst@didntduck.org)
Wed, 05 Dec 2001 11:14:59 -0500


Cyrille Beraud wrote:
>
> Hello,
> I would like to remove an executable from the file-system while it is
> running and
> get all the blocks back immediately, not after the end of the program.
> Is this possible ?
> From what I understand, the inode is not released until the program
> ends. Do all the
> file-systems behave the same way ?
>
> Thank you for your help.

It is not possible to reclaim the disk space until the program exits.
This is because of demand paging of executables. The file must be kept
around to handle possible future page faults, otherwise the program
would crash if it called code that hadn't been loaded yet or was
discarded due to memory pressure. This is true of all filesystems.

--

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