[GRASS-user] r.cost: exact meaning of percent_memory ?

Moritz Lennert mlennert at club.worldonline.be
Fri Jan 23 09:16:21 PST 2015


On 22/01/15 21:12, Markus Metz wrote:
> On Thu, Jan 22, 2015 at 2:30 PM, Moritz Lennert
> <mlennert at club.worldonline.be> wrote:
>> I am trying to understand the 'percent_memory' option in r.cost. In the man
>> page it says: "The amount of map to hold in memory at one time can be
>> controlled with the percent_memory option. For large maps this value will
>> have to be set to a lower value.".
>
> The man page is wrong, it is not the amount of the map, but the amount
> of the current region.

Ok.

>
>>
>> IIUC, this would mean that if I have a region of X DCELL cells, I would
>> need: X*8 bytes of memory, or ?
>
> No, it would need X * 3 * 8 bytes (if direction output is requested,
> another X * 4 bytes). Considering that you are a power user and
> developer, and that you do not understand the 'percent_memory' option,
> it is high time to change that option to the standard memory option
> where the user specifies the amount of memory in MB that should be
> used.

Yes. I do plead guilty for not haven taken the time to look at the code 
in detail to understand, but the man page definitely does not help. If 
this can be changed into the standard memory option, this would be 
great. If this cannot be done soon, then a change to the man page would 
already be a plus, maybe indicating the calculations.

>>
>> So if memory available is > X*8 I should be able to use percent_memory=100
>> (or at least 75). Is that correct ?
>
> No, see also above, the input cost surface, the output accumulated
> cost surface, and the cell value of the nearest starting point are
> held in memory. If a direction output map is requested, this one is
> also held in memory.

This info should go into the man page.

Moritz


More information about the grass-user mailing list