[R] How to verify using more than 2GB of memory
Prof Brian Ripley
ripley at stats.ox.ac.uk
Tue Jan 4 19:46:09 CET 2005
You forgot that 32-bit machines do integer operation mod 2^32.
So you actually asked for a memory limit of 0, which was a decrease.
We do recommend that you use the command-line flag, e.g. in the rw-FAQ.
% rterm --max-mem-size=4096M
WARNING: --max-mem-size=4096`M': too large and ignored
would have told you the error.
You don't seem to appreciate the difference between `limit' and
`allocate': please read the help page for memory.limit with a modicum of
care. Once you appreciate that you have seriously misread the page,
things will become a lot clearer.
On Tue, 4 Jan 2005, roger bos wrote:
> My machine has 4Gb of memory under WinXP Pro. Re-reading R for
> Windows FAQ 2.7 I discovered that I can use editbin to add the
> "/LARGEADDRESSAWARE" tag in the header without re-compiling, so that
> is what I did. I also check that it worked using dumpbin. I then
> edited my Boot.ini file to add the /3GB switch. Then I went to my
> R.0.0.1 patched that I modified as above and checked memory limit:
>
>> memory.limit(NA)
> [1] 1073741824
>
> This is usual default.
>
>> memory.limit(3*1024)
> NULL
>> memory.limit(4*1024)
> Error in memory.size(size) : cannot decrease memory limit
>
> It seems to work, since I am able to allocate 3Gb of memory, but not
> 4Gb (though the error message I get isn't very helpful since I am
> clearly not trying to decrease the memory limit).
>
> However, this does not seem a good way to check that my
> LARGEADDRESSAWARE version of R is working properly, because when I do
> the same memory.limit operations on 2.0.1.0 dev that I downloaded this
> morning I get the same results, without having made the program
> LARGEADDRESSAWARE
>
> Also, although trying to allocate 4Gb of memory does produce an error,
> I can allocate 3.9Gb, which seems hard to beleive because the OS is
> supposed to reserve 1Gb.
>
>> memory.limit(3.9*1024)
> NULL
>> memory.limit(NA)
> [1] 4187593113
>>
>
> So, finally, here are my questions, in order of interest:
> 1) Once I have made my version of R LARGEADDRESSAWARE, how do I best
> verify that all is well?
> 2) Why was I able to increase the memory.limit to 3.9Gb on the new
> version of R.0.1.0 that I did not make LARGEADDRESSAWARE?
> 3) Is there any side-effect to making a program LARGEADDRESSAWARE? I
> don't want to sound lazy, but for the benefit of those who don't have
> Visual Studio, why not make the distributed binary LARGEADDRESSAWARE?
The maintainer does not have it. Simple!
--
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272866 (PA)
Oxford OX1 3TG, UK Fax: +44 1865 272595
More information about the R-help
mailing list