[R] How to clear R memory in a for loop

Dimitri Liakhovitski dimitri.liakhovitski at gmail.com
Mon Oct 20 17:30:21 CEST 2014


Dear Rers,

I am trying to run a for-loop in R.
During each iteration I read in an mp3 file and do some basic processing.
If I do what I need to do for each file one by one - it works fine.
But once I start running a loop, it soon runs out of memory and says: can't
allocate a vector of size...
In each iteration of my loop I always overwrite the previously created
object and do gc().

Any hints on how to fight this?

Thanks a lot!

	[[alternative HTML version deleted]]



More information about the R-help mailing list