From kirill.mueller at ivt.baug.ethz.ch  Wed May 11 10:42:56 2016
From: kirill.mueller at ivt.baug.ethz.ch (=?UTF-8?Q?Kirill_M=c3=bcller?=)
Date: Wed, 11 May 2016 10:42:56 +0200
Subject: [Rd] R process killed when allocating too large matrix (Mac OS
	X)
In-Reply-To: <CABFfbXtm5hOW+ah_bjtnP5QproRnGXBtPUsKDK54SXqGfQu=Qg@mail.gmail.com>
References: <CAM3-KjYqc5CvDt4yKkOEPw--1Fq-c8O8x6UfFir5x==-UwFYvw@mail.gmail.com>
	<0e0160ec793649dda463b43d7e7d5c37@CONNHUB1.connect.uwaterloo.ca>
	<CAM3-Kja40deG=04U+PDNjLD=sHzQRiz_umia+wBEP77YyW5qQA@mail.gmail.com>
	<9b3da5c7758b455baad7209384abe7a7@CONNHUB4.connect.uwaterloo.ca>
	<CAM3-KjZ13TOz7x6DC+F1=9WsJFHbz4Ay0gf-fhQOv84oSRiE=w@mail.gmail.com>
	<308D9A3B-C40F-4AF7-AF1A-43DC8E1130EF@r-project.org>
	<572AA6AF.9040400@fredhutch.org>
	<3e8b8d2d46ac440892d2055c502b5be9@CONNHUB1.connect.uwaterloo.ca>
	<CAM3-KjbDejim0PSj9s5ognw4wfA=_BvD2UmfVDdmixqww2MkoA@mail.gmail.com>
	<2fa1c8e2-c692-1237-ea3c-572397038b26@statistik.tu-dortmund.de>
	<572B14D9.3050005@stats.ox.ac.uk>
	<CABFfbXtm5hOW+ah_bjtnP5QproRnGXBtPUsKDK54SXqGfQu=Qg@mail.gmail.com>
Message-ID: <5732F090.8020301@ivt.baug.ethz.ch>

My ulimit package exposes this API ([1], should finally submit it to 
CRAN); unfortunately this very API seems to be unsupported on OS X 
[2,3]. Last time I looked into it, neither of the documented settings 
achieved the desired effect.


-Kirill


[1] http://krlmlr.github.io/ulimit
[2] 
http://stackoverflow.com/questions/3274385/how-to-limit-memory-of-a-os-x-program-ulimit-v-neither-m-are-working
[3] 
https://developer.apple.com/library/ios/documentation/System/Conceptual/ManPages_iPhoneOS/man2/getrlimit.2.html


On 10.05.2016 01:08, Jeroen Ooms wrote:
> On 05/05/2016 10:11, Uwe Ligges wrote:
>> Actually this also happens under Linux and I had my R processes killed
>> more than once (and much worse also other processes so that we had to
>> reboot a server, essentially).
> I found that setting RLIMIT_AS [1] works very well on Linux. But this
> requires that you cap memory to some fixed value.
>
>> library(RAppArmor)
>> rlimit_as(1e9)
>> rnorm(1e9)
> Error: cannot allocate vector of size 7.5 Gb
>
> The RAppArmor package has many other utilities to protect your server
> such from a mis-behaving process such as limiting cpu time
> (RLIMIT_CPU), fork bombs (RLIMIT_NPROC) and file sizes (RLIMIT_FSIZE).
>
> [1] http://linux.die.net/man/2/getrlimit
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] R process killed when allocating too large matrix (Mac OS X)
=?UTF-8?Q?Kirill_M=c3=bcller?=