From kirill.mueller at ivt.baug.ethz.ch  Fri May 13 11:03:22 2016
From: kirill.mueller at ivt.baug.ethz.ch (=?UTF-8?Q?Kirill_M=c3=bcller?=)
Date: Fri, 13 May 2016 11:03:22 +0200
Subject: [Rd] R process killed when allocating too large matrix (Mac OS
	X)
In-Reply-To: <22324.13850.608673.341820@stat.math.ethz.ch>
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>
	<5732F090.8020301@ivt.baug.ethz.ch>
	<22324.13850.608673.341820@stat.math.ethz.ch>
Message-ID: <5735985A.3070507@ivt.baug.ethz.ch>

On 12.05.2016 09:51, Martin Maechler wrote:
>      > 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
>
>
> ...
>
> In an ideal word, some of us,
>      from R core, Jeroen, Kyrill, <one person knowing much about Windows>,
>      maintainer("microbenchmark>, ...
> would sit together and devise an R function interface (based on
> low level platform specific interfaces, specifically for at least
> Linux/POSIX-compliant, Mac, and Windows) which would allow
> something  like your rlimit(..) calls below.
>
> We'd really need something to work on all platforms ideally,
> to be used by R package maintainers
> and possibly even better by R itself at startup, setting a
> reasonable memory cap - which the user could raise even to +Inf (or lower
> even more).
>
I haven't found a Windows API that allows limiting the address space, 
only one that limits the working set size; it seems likely that this is 
the best we can get on OS X, too, but then my experience with OS X is 
very limited.

mallinfo() is used on Windows and seems to be available on Linux, too, 
but not on OS X.


-Kirill



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