[systemd-devel] MemoryLimit and MemorySoftLimit

Manuel Amador rudd-o at rudd-o.com
Mon Mar 26 02:44:33 PDT 2012


memorylimit and memorysoftlimit can be determined using the ulimit system 
call.

you cannot detect when you've hit the soft limit other than by getting a NULL 
on malloc.

On Monday, March 26, 2012 11:06:42 Albert Strasheim wrote:
> Hello all
> 
> We want to limit the memory a service can use using MemoryLimit= and
> MemorySoftLimit= described in systemd.exec.
> 
> As I understand it, LimitAS= and LimitRSS= aren't particularly useful.
> Linux doesn't even implement LimitRSS?
> 
> http://unix.stackexchange.com/questions/32368/how-to-limit-application-memor
> y-usage
> 
> Is there a way for an application to detect when it has hit its
> MemorySoftLimit=? We would like to log a warning at this point.
> 
> Also, is there some standard way for the application to determine if a
> MemoryLimit= is configured? We might want to automatically size some
> buffers based on this limit.
> 
> Thanks in advance.
> 
> Regards
> 
> Albert
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
    Manuel Amador (Rudd-O)
    http://rudd-o.com/


More information about the systemd-devel mailing list