[Rd] A question on R memory management in .Fortran() calls under Windows

Simone Giannerini sgiannerini at gmail.com
Mon Sep 12 10:30:05 CEST 2005


Dear Duncan and Simon,

many thanks for your helpful reply.

> Duncan Murdoch wrote:
> It looks as though your Fortran compiler is allocating the new matrix on
> the stack.  R doesn't give you a huge stack, and that's causing the
> overflow.  When you get R to do the allocation, it does it on the heap,
> which has no artificial limits.  Only a pointer to the object ends up on
> the stack.
 
yes, CVF allocates automatic objects on the stack and apparently there
is no way of changing it. By the way, increasing the stack of the
fortran process when linking does not solve the problem

> I'd say your only reasonable workarounds are to tell your compiler to
> use the heap for the local matrix allocation (if that's possible), or do
> your allocations in R.

I might follow the second way, in any case, I am considering switching
to Linux, I have also  considered changing compiler under Win,  any
suggestions on the choice would be welcomed.
 
Many thanks again,
kind regards,

Simone Giannerini



More information about the R-devel mailing list