[GRASS-dev] r.watershed and swap memory

ivan marchesini marchesini at unipg.it
Tue Mar 18 05:32:14 EDT 2008

Dear Grass Users and Developers, sorry for cross posting but we hope the
argument can be of interest for all and we hope someone can give us a
solution to this problem..

We have this kind of problem:
* a large DEM (150000000 cells)
* an ordinary computer (2 GB ram)
* we must obtain the drainage map using r.watershed (without changing
resolution), because then we need to be able to calculate the upstream
basin for each cell (r.water.outlet).
* we have tried r.watershed straigth (but after few seconds a memory
allocation problem crashed the program)  
* we have tried the "-m" option but after 4 days of work it is still at
* giving up the last option, because it takes too long, we have
monitored the ram usage by means of "free -m" and we have seen that
r.watershed rapidly saturate the ram and then, after a little usage of
swap (20 mb) crashes..  so it seems that r.watershed doesn't use swap
memory... (and is then unuseful, as we did, to increase the swap
* we have tried to modify
"Swappiness" (http://www.gentoo.it/doc/memory.html#doc_chap5) but
without success... the error is still the same

so at this point:
* is adding ram to the computer the only solution?
* if yes, how can we estimate the ram to buy!
* can we obtain some better results compiling grass with option
* does someone solved a similar problem in some other way?

Thank you for your suggestions!!!
we hope really in your help

Luca & Ivan


Ti prego di cercare di non inviarmi files .dwg, .doc, .xls, .ppt.
Preferisco formati liberi.
Please try to avoid to send me .dwg, .doc, .xls, .ppt files.
I prefer free formats.

Ivan Marchesini
Department of Civil and Environmental Engineering
University of Perugia
Via G. Duranti 93/a 
Perugia (Italy)
Socio fondatore GFOSS "Geospatial Free and Open Source Software" http://www.gfoss.it
e-mail: marchesini at unipg.it
        ivan.marchesini at gmail.com
tel: +39(0)755853760
fax (university): +39(0)755853756
fax (home): +39(0)5782830887
jabber: geoivan73 at jabber.org

More information about the grass-dev mailing list