Message-ID: <1776207391.150876.1459942799106.JavaMail.yahoo@mail.yahoo.com>
Date: 2016-04-06T11:39:59Z
From: Amelia Marsh
Subject: Memory problem
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