[R] Memory problem

Amelia Marsh amelia_marsh08 at yahoo.com
Wed Apr 6 13:39:59 CEST 2016


Dear R Forum,

I have about 2000+ FX forward transactions and I am trying to run 1000 simulations. If I use less no of simulations, I am able to get the desired results. However, when I try to use more than 1000 simulations, I get following error.

> sorted2 <- ddply(sorted, .(currency_from_exch, id), mutate, change_in_mtm_bc = mtm_bc - mtm_bc[1]) 

Error: cannot allocate vector of size 15.6 Mb 


In addition: Warning messages: 
1: Reached total allocation of 3583Mb: see help(memory.size) 
2: Reached total allocation of 3583Mb: see help(memory.size) 
3: In output[[var]][rng] <- df[[var]] : 
Reached total allocation of 3583Mb: see help(memory.size) 
4: In output[[var]][rng] <- df[[var]] : 
Reached total allocation of 3583Mb: see help(memory.size) 
5: In output[[var]][rng] <- df[[var]] : 
Reached total allocation of 3583Mb: see help(memory.size) 
6: In output[[var]][rng] <- df[[var]] : 
Reached total allocation of 3583Mb: see help(memory.size) 
7: In output[[var]][rng] <- df[[var]] : 
Reached total allocation of 3583Mb: see help(memory.size) 
8: In output[[var]][rng] <- df[[var]] : 
Reached total allocation of 3583Mb: see help(memory.size)


When I checked -

> memory.size() 
[1] 846.83 
> memory.limit() 
[1] 3583


The code is bit lengthy and unfortunately can't be shared.

Kindly guide how this memory probelm can be tackled? I am using R x64 3.2.0

Regards

Amelia



More information about the R-help mailing list