Error: cannot allocate vector of size 13813.6 Gb

Operating System: Windows 10 64bit
Interface Version: RStudio 1.1.456
Compiler/Toolkit: ??

STANs been more than difficult to use for someone who is not tech savvy and just wants to run some class code. First I had to write my own PATH and BINPREFs, and now this. I have yet to be able to run a MCMC sim once.

What information do I need to provide to solve this issue? I am on Windows 10, using 64bit Windows and 64bit Rstudio. I have 32GB of RAM with current usage hovering at 12GB because I have lots of tabs open in Google Chrome.

Typing this into RStudio gets me the following:

[1] 1.759219e+13
[1] “/x64”

Additionally, after trying to re-run the code again, I get this error instead:

Error in get(“storage”, envir = as.environment(x)) :
object ‘storage’ not found

Edit: I doubt this is an issue with the code itself as I just tried to run a completely different simulation and got the exact same vector error.

Error: cannot allocate vector of size 13813.6 Gb

It would be too much of a coincidence if two completely different data sets and models lead to the same sized memory error.

Thanks for the help and time.

Ooofff. That does indeed sound very bad. Could you give us a little bit more information to help you out?

For instance, do you know which version of rstan you are using? Can you run the standard 8 schools example code?


Last time I saw this error (thread in Discourse), the solution was to reinstall Rcpp.

1 Like

No I can’t run the 8schools script, I am still getting the same error. Also:

R version 3.6.1 (2019-07-05)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252

attached base packages:
[1] parallel stats graphics grDevices utils datasets methods base

other attached packages:
[1] runjags_2.0.4-4 rjags_4-9 coda_0.19-3 rstan_2.19.2 ggplot2_3.2.1 StanHeaders_2.19.0

loaded via a namespace (and not attached):
[1] Rcpp_1.0.1 pillar_1.3.1 compiler_3.6.1 remotes_2.1.0 prettyunits_1.0.2 tools_3.6.1
[7] testthat_2.2.1 pkgload_1.0.2 digest_0.6.18 pkgbuild_1.0.6 memoise_1.1.0 tibble_2.1.1
[13] gtable_0.3.0 lattice_0.20-38 pkgconfig_2.0.2 rlang_0.3.4 cli_1.1.0 rstudioapi_0.10
[19] yaml_2.2.0 loo_2.1.0 gridExtra_2.3 withr_2.1.2 dplyr_0.8.0.1 fs_1.3.1
[25] desc_1.2.0 devtools_2.2.1 rprojroot_1.3-2 stats4_3.6.1 grid_3.6.1 tidyselect_0.2.5
[31] glue_1.3.1 inline_0.3.15 R6_2.4.0 processx_3.4.1 sessioninfo_1.1.1 purrr_0.3.2
[37] callr_3.3.2 magrittr_1.5 usethis_1.5.1 backports_1.1.4 ellipsis_0.3.0 scales_1.0.0
[43] ps_1.3.0 matrixStats_0.55.0 assertthat_0.2.1 colorspace_1.4-1 lazyeval_0.2.2 munsell_0.5.0
[49] crayon_1.3.4

I tried reinstalling that and same thing.

1 Like

Possibly take the -march=native and -mtune=native out of ~/.R/ and don’t specify it in LOCAL_CPPFLAGS.

Ok I finally got the 8schools code to work. I had to manually go into my library and delete Rcpp, then reinstall it that way for it to work. When installing via R it was locked for some reason.

I also messed around with the “permissions” of my R folder but I don’t think that solved the problem - just for future reference.

Now onto some real simulations.



@confused Thanks for letting us know. We’re definitely trying to find ways to make Stan and the interfaces easier to use, but unfortunately there are still things like what you encountered that can be super annoying and sometimes a real impediment. Sorry for the hassle but glad you’ve got it up and running now!


16 posts were split to a new topic: Cannot resolve the "cannot allocate vector of size … " error