Reputation: 1023
I'm getting an error for "recursive gc invocation" just loading some packages. If I set my code to run further, this error continues to pop out throughout, and R studio experiences a fatal error and aborts. I do not know how to trouble shoot this to fix it.
I have already tried to restart the program, but get the same error in the same place. This happens even if I restart the program, close the project, and try again in a new / blank script. The error is shown below.
What are appropriate steps at this juncture? Should I uninstall /reinstall R? Is there a better way to try to pinpoint what is going wrong?
This is what I get in the console when I load these two libraries:
> library(descr)
> library(data.table)
*** recursive gc invocation
*** recursive gc invocation
*** recursive gc invocation
data.table 1.14.2 using 4 threads (see ?getDTthreads). Latest news: r-datatable.com
I included session info if that helps, but honestly I'm not really sure where to begin trouble shooting this.
> sessionInfo()
R version 4.1.2 (2021-11-01)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19044)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] beepr_1.3 nngeo_0.4.4 stringr_1.4.0 bit64_4.0.5 bit_4.0.4 sf_1.0-5 data.table_1.14.2 descr_1.1.5
loaded via a namespace (and not attached):
[1] Rcpp_1.0.7 magrittr_2.0.1 units_0.7-2 xtable_1.8-4 R6_2.5.1 rlang_0.4.12 tools_4.1.2 grid_4.1.2
[9] audio_0.1-10 KernSmooth_2.23-20 e1071_1.7-9 DBI_1.1.2 ellipsis_0.3.2 class_7.3-19 lifecycle_1.0.1 vctrs_0.3.8
[17] glue_1.6.0 stringi_1.7.6 proxy_0.4-26 compiler_4.1.2 generics_0.1.1 classInt_0.4-3
Upvotes: 1
Views: 1665
Reputation: 23757
Same problem. My solution below.
I ran into this after
my computer (MacBook Pro 2017 running on OSX Big Sur 11.2.1) crashed (I don't know the reason)
when I re-opened an R project where "big data" had been loaded into the environment, it froze (I assume it struggled to find / load the data) and no matter what I tried (restart R, clear workspace etc), nothing helped.
I could only open the project again after deleting the (hidden) project files. I also deleted .RProj.user (might have been enough to only delete .Rhistory ?)
RStudio worked again, but when I ran a long pipe on a data frame with 300k rows, error *** recursive gc invocation
occurred .
I then tried calling gc() first as suggested elsewhere, but then
Error in loadedNamespaces() : bad hash table contents
or
gc Error: Invalid mset
My solution
I did not need to re-install R, but luckily enough had not double deleted my .RProj.user folder and put it back where it was before - this seemed to have fixed the problem for now.
Upvotes: 0
Reputation: 11
I've had the same problem. Loading data.table and then having those recursive gc invocation. I have found it to be very close in nature to this issue: https://github.com/rstudio/rstudio/issues/10565
no fixes yet, but seems to be an Rstudio Ghost Orchid issue
Upvotes: 1
Reputation: 1023
To others who may find this problem, this is what I did. I don't know how it fixed it, but it's working;
Is this a good way to solve this problem? No clue. Will this work for everyone? Also no idea. But it fixed it in my case. ¯_(ツ)/¯ ¯_(ツ)/¯
Upvotes: 0