memory issues with calc_subbas
Closed this issue · 2 comments
For large catchments (e.g. Sao Francisco) calc_subbas issues this error:
Calculate drainage and river network...
ABSCHNITT 1a (von 4): Initiiere den Speicher.
Aktuelle Region Zeilen: 20217, Spalten: 14047
FEHLER: G_malloc: Kann nicht 2272853112 Byte auf init_vars.c:134 reservieren
According to other users, this is a memory issue, created by GRASS GIS
r.watershed
It is recommended to activate the flag
-m
(Enable disk swap memory option: Operation is slow
Only needed if memory requirements exceed available RAM; see manual on how to calculate memory requirements, http://grass.osgeo.org/grass70/manuals/r.watershed.html#in-memory-mode-and-disk-swap-mode)
I introduced the optional argument "disk_swap". If set to TRUE, this will use the "w"-flag. Please check and report.
Alternatively, both 'flowaccum' and 'flowdir' maps can now be computed externally, e.g. with r.terraflow which is supposed to better handle large grids. Make sure grid coding conventions are consistent. Please report or reopen issue when the need arises.