Last active
March 13, 2024 23:15
-
-
Save multimeric/8ebb7948b5ad3384649da63bc0e59bb9 to your computer and use it in GitHub Desktop.
Demonstration of odd memory usage in R whereby the resident set size (RSS) doesn't change despite allocating more memory and later clearing it
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```{r} | |
RSQLite::SQLite() |> | |
DBI::dbConnect(":memory:") |> | |
RSQLite::dbWriteTable("foo", data.frame( | |
a = numeric(1E8) | |
)) | |
invisible(gc()) | |
ps::ps_memory_info() | |
y <- integer(1E8) | |
ps::ps_memory_info() | |
rm(y) | |
invisible(gc()) | |
ps::ps_memory_info() | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment