I am having a big issue of this G_malloc Error while using a module of Grass (6.4.4) (r.stream.extract) in R. Initially I thought my computers configuration was low, So I switched to 8gb Ram 64-bit Windows 10. And I found error occurring again. I tried setting the g.region to the current using DEM with the following function.
"execGRASS("g.region",flags= "a", parameters=list(rast="DEM")"
The error function is:
"execGRASS("r.stream.extract", flags="overwrite", parameters=list(elevation="DEM", accumulation="Accumulation", threshold=round(AT_mean[[i]], digit=0), mexp=0.01, stream_rast="Stream_Comparison"))"
and the error is as follows:
"Current region rows: 8129, cols: 10704 ERROR: G_malloc: unable to allocate 696102528 bytes of memory at main.c:259 Warning message: running command 'r.stream.extract.exe --overwrite elevation=DEM accumulation=Accumulation threshold=6 mexp=0.01 stream_rast=Stream_Comparison' had status 1"
I tried solving it in many ways such as, allocating memory using memory.limit(), setting up the computational region and also dividing the DEM into half. But nothing was successful.