From sgiannerini at gmail.com  Mon Sep 12 10:30:05 2005
From: sgiannerini at gmail.com (Simone Giannerini)
Date: Mon, 12 Sep 2005 10:30:05 +0200
Subject: [Rd] A question on R memory management in .Fortran() calls
	under Windows
In-Reply-To: <4321CBB4.3090805@stats.uwo.ca>
References: <3c12769c0509091004555400f@mail.gmail.com>
	<4321CBB4.3090805@stats.uwo.ca>
Message-ID: <3c12769c05091201305a31f10f@mail.gmail.com>

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



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