R 自发地开始使用 20 GB 内存

发布于 2025-01-14 16:07:22 字数 1171 浏览 1 评论 0原文

我一直在 R 中“设置”一个新项目,即将一些代码复制在一起,我几乎没有运行任何内容,并且今天打开项目时出现错误:

WARNING: Failed to restore workspace from 'mywd/RData'
Reason: cannot allocate vector of size 172 Kb

我的环境的屏幕截图

谁能解释一下这是怎么回事从,我试过:

rm(list=ls(all=T))

gc()

哪个已将内存使用量减少到 17.88 GB,但这似乎仍然过多...

更新

我关闭了 RStudio 并重新打开它,我的内存使用量(没有任何加载的库或数据)已减少到 858 MB。我仍然对为什么会发生这种情况以及如果再次发生这种情况该怎么办感到困惑。

更新2 使用的软件包...是的,我需要所有这些。

表格

库(tidyverse) 图书馆(管理员) 图书馆(tidyr) 库(重塑2) 图书馆(读者) 库(数据.表) 库(plyr)

分类

库(Taxonstand)

数据库

库(DBI) 库(odbc) 库(dbplyr) 图书馆(knitr)

空间

图书馆(sp) 库(光栅) 图书馆(rgdal) 库(地图工具) 图书馆(rgeos) 库(范围生成器) 图书馆(地圈) 图书馆(rgdal) 图书馆(SF) 库(vegan)

图形

库(ggplot2) 库(RColorBrewer) 图书馆(扫帚) 库(网格额外) 图书馆(ggmcmc) 图书馆(ggforce) 库(Hmisc) 图书馆(牛区) 库(ggpmisc) 库(gtable) 库(egg)

贝叶

斯库(R2WinBUGS) 库(runjags)

库(R2jags) 图书馆(rjags) 库(dclone)

建模

库(psych) 库(betareg) 图书馆(尾声)

I have been "setting up" a new project in R, i.e. copying bits of code together, I have run almost nothing and got an error when opening the project today:

WARNING: Failed to restore workspace from 'mywd/RData'
Reason: cannot allocate vector of size 172 Kb

Screenshot of my Environment

Can anyone explain where this is coming from, I've tried:

rm(list=ls(all=T))

gc()

which has reduced the memory usage to 17.88 GB, but that still seems excessive...

update

I closed RStudio and reopened it and my memory usage (without any loaded libraries or data) had reduced to 858 MB. I'm still confused about why this happened and what to do if it happens again.

update2
packages used... and YES, I need all of them.

tables

library(tidyverse)
library(janitor)
library(tidyr)
library(reshape2)
library(readr)
library(data.table)
library(plyr)

taxonomy

library(Taxonstand)

database

library(DBI)
library(odbc)
library(dbplyr)
library(knitr)

spatial

library(sp)
library(raster)
library(rgdal)
library(maptools)
library(rgeos)
library(rangeBuilder)
library(geosphere)
library(rgdal)
library(sf)
library(vegan)

graphics

library(ggplot2)
library(RColorBrewer)
library(broom)
library(gridExtra)
library(ggmcmc)
library(ggforce)
library(Hmisc)
library(cowplot)
library(ggpmisc)
library(gtable)
library(egg)

Bayes

library(R2WinBUGS)
library(runjags)

library(R2jags)
library(rjags)
library(dclone)

Modelling

library(psych)
library(betareg)
library(coda)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文