[MPlayer-dev-eng] [RFC] rlimits support

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Oct 9 16:14:54 CEST 2010


On Sat, Oct 09, 2010 at 09:56:03AM -0400, compn wrote:
> On Sat, 9 Oct 2010 15:03:53 +0200, Reimar Döffinger wrote:
> >this is an unfinished patch to add support for rlimits.
> >The main point of it would be to limit RLIMIT_DATA to something
> >"reasonable" like e.g. 512 MB by default, which for most users
> >would guarantee that MPlayer never causes an unusable system
> >due to a memleak and excessive swapping caused by that.
> >This should also make it possible to test in a semi-automated
> >way that MPlayer can handle out-of-memory conditions where
> >NULL is returned by malloc. 
> >It lacks at the very least: configure check, command-line option,
> >documentation.
> 
> any idea which OS supports rlimit ? e.g. mplayer builds on osx,
> cygwin/mingw, os/2, bsd etc.

man page says: CONFORMING TO SVr4, 4.3BSD, POSIX.1-2001.
OS/2 doesn't have it and probably does not have anything comparable,
nor will probably BeOS and similar.
Which is why I said we need a configure check.
However attached is a version that might work on Windows already.

> >Index: mplayer.c
> 
> is it wise to add this to mencoder too? or mpcommon so both mplayer and
> mencoder can use it? sorry for any dumb questions.

Doesn't really fit into mpcommon yet, however there are some things I should
move there.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rlimits.diff
Type: text/x-diff
Size: 4962 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20101009/bbb1c386/attachment.diff>


More information about the MPlayer-dev-eng mailing list