Re: [R] reclaiming lost memory in R

2012-04-10 Thread Ramiro Barrantes
2 11:17 AM To: William Dunlap Cc: Ramiro Barrantes; r-help@r-project.org Subject: Re: [R] reclaiming lost memory in R A few days ago I responded to Ramiro with a suggestion that turns out to be incorrect. > Ramiro > > I think the problem is the loop - R doesn't release memory allocated in

Re: [R] reclaiming lost memory in R

2012-04-10 Thread Drew Tyre
A few days ago I responded to Ramiro with a suggestion that turns out to be incorrect. > Ramiro > > > > I think the problem is the loop - R doesn't release memory allocated > inside > > an expression until the expression completes. A for loop is an > expression, > > so it duplicates fit and datase

Re: [R] reclaiming lost memory in R

2012-04-06 Thread Liviu Andronic
On Fri, Apr 6, 2012 at 2:21 PM, Ramiro Barrantes wrote: > Please let me know if you have any other suggestions or clues. > See this older post by Brian [1] and check ?"Memory-limits". Otherwise, I remember someone suggesting that even if R releases the memory internally, the OS may still keep it r

Re: [R] reclaiming lost memory in R

2012-04-06 Thread Ramiro Barrantes
Please let me know if you have any other suggestions or clues. Ramiro From: William Dunlap [wdun...@tibco.com] Sent: Thursday, April 05, 2012 9:21 PM To: Drew Tyre; Ramiro Barrantes Cc: r-help@r-project.org Subject: RE: [R] reclaiming lost memory in R

Re: [R] reclaiming lost memory in R

2012-04-05 Thread William Dunlap
> -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of Drew Tyre > Sent: Thursday, April 05, 2012 8:35 AM > To: Ramiro Barrantes > Cc: r-help@r-project.org > Subject: Re: [R] reclaiming lost memory in R >

Re: [R] reclaiming lost memory in R

2012-04-05 Thread Drew Tyre
Ramiro I think the problem is the loop - R doesn't release memory allocated inside an expression until the expression completes. A for loop is an expression, so it duplicates fit and dataset on every iteration. An alternative approach that I have found successful in similar circumstances is to use

[R] reclaiming lost memory in R

2012-04-05 Thread Ramiro Barrantes
Dear list, I am trying to reclaim what I think is lost memory in R, I have been using gc(), rm() and also using Rprof to figure out where all the memory is going but I might be missing something. I have the following situation basic loop which calls memoryHogFunction: for i in (1:N) { dat