memtools provides debugging tools to detect and solve memory leaks in R:
See vignette("memtools") for a tutorial.
vignette("memtools")
Install memtools from github with:
remotes::install_github( "r-lib/memtools", build_manual = TRUE, build_vignettes = TRUE )