On Jun 10, 2014, at 1:43 PM, Herra Huu <
heikki.uu...@gmail.com> wrote:
> Has this problem been fixed in version 2.3.0? If not, here is a simple example of the model with memory leak (R code including the data generation + Stan model).
Thanks for the example.
I just verified that Herra Huu's model
* leaks in RStan 2.2.0 (over 4GB at 2K iterations), but
* is fine on the develop branch for CmdStan (under 5MB
at 2K iterations!).
We should make sure the RStan 2.3.0 release candidate doesn't
leak. It shouldn't --- if there was a function leak, that'd be
in the Stan C++ code that is called by both CmdStan and RStan.
- Bob
P.S. As an aside, for a real model, you almost certainly
don't want to do this:
data {
int<lower=1,upper=K> y[N_obs];
...
model {
for (n in 1:N_obs)
y ~ categorical_logit(beta);
...
which uses each of the N_obs data items N_obs times due to vectorization.
I would've expected this:
for (n in 1:N_obs)
y[n] ~ categorical_logit(beta);