Skip to content
Prev 13536 / 29559 Next

Problem creating raster brick (Lyndon Estes)

Hi Robert,

Thanks for the response.  I will continue to keep forcing a write to
disk to prevent this from occurring.

Based on this post, and another earlier in the year, I looked a bit
more into other methods for calculating available RAM, at least for
Linux and Mac systems.  I understand from some of the posts I have
seen that this is a fairly tricky subject, but something like the
following might give available memory (in mb) on a linux system:

system("free -t -m | awk 'FNR == 5 {print $4}'", intern = T)

On a mac, I believe the "alloc" command might do the trick, but for
some reason my system (10.5.8) doesn't have it so I couldn't test
that.  Another way might be to access the summary from top, e.g.

as.numeric(sub("M", "", system("top -l 1 | awk 'FNR == 6 {print
$10}'", intern = T)  # 40M))

But I am not at all sure that that particular number is the right one
to use as an indicator of available memory (looks very conservative).

Anyway, looking into the code for canProcessInMemory, I see that you
already have similar solutions worked in but commented out, so I guess
these solutions might not be desirable.


Cheers, and thanks again, Lyndon
On Wed, Nov 23, 2011 at 7:38 PM, Robert J. Hijmans <r.hijmans at gmail.com> wrote: