RStudio Server 不使用 buff/cache 内存
RStudio Server does not use the buff/cache memory
我正在 RStudio 服务器上加载一些大型 .csv 文件,这需要大约 73gb。服务器是具有 125GB RAM 的 Ubuntu 18.04.5 LTS
,因此理论上我应该能够在 RAM 上加载更多数据并进行需要更多 RAM 的计算。但是,RStudio Server 拒绝并显示以下错误消息:
“错误:无法分配大小为 3.9 Gb 的向量”。
查看 free -mh
似乎有 available
42GB 的内存,但 RStudio 没有使用它。
~:$ free -mh
total used free shared buff/cache available
Mem: 125G 81G 1.2G 28M 43G 42G
Swap: 979M 4.0M 975M`
为什么会这样,我如何利用这 42GB 进行计算?
top
输出:
top - 11:05:58 up 21:19, 1 user, load average: 0.24, 0.22, 0.22
Tasks: 307 total, 1 running, 201 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.6 us, 0.2 sy, 0.1 ni, 99.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 13170917+total, 1216824 free, 85389312 used, 45103040 buff/cache
KiB Swap: 1003516 total, 999420 free, 4096 used. 45033504 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
4292 user1 30 10 39956 5052 4272 S 2.6 0.0 0:06.94 galaxy
1171 root 20 0 488892 44216 7540 S 1.3 0.0 12:24.39 cbdaemon
5998 user1 20 0 44428 3936 3168 R 1.0 0.0 0:00.07 top
6153 user1 20 0 275740 101112 29396 S 0.7 0.1 25:55.97 nxagent
1207 root 20 0 377116 163944 68132 S 0.3 0.1 5:37.13 evl_manager
1247 root 20 0 1262092 63308 14956 S 0.3 0.0 0:35.77 mcollectived
6623 user1 20 0 126640 5852 3212 S 0.3 0.0 0:02.48 sshd
7413 user1 20 0 80.623g 0.078t 53712 S 0.3 63.8 20:14.46 rsession
1 root 20 0 225756 8928 6320 S 0.0 0.0 0:23.05 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:00.02 kthreadd
...
令人惊讶的是,问题不在 OS 或 R/RStudio 服务器上,而是在使用 data.table
时,我曾用它打开 .csv 文件。显然,它阻止了系统使用可用内存。一旦我移动到 dplyr
,我就可以毫无问题地利用系统的所有内存。
我正在 RStudio 服务器上加载一些大型 .csv 文件,这需要大约 73gb。服务器是具有 125GB RAM 的 Ubuntu 18.04.5 LTS
,因此理论上我应该能够在 RAM 上加载更多数据并进行需要更多 RAM 的计算。但是,RStudio Server 拒绝并显示以下错误消息:
“错误:无法分配大小为 3.9 Gb 的向量”。
查看 free -mh
似乎有 available
42GB 的内存,但 RStudio 没有使用它。
~:$ free -mh
total used free shared buff/cache available
Mem: 125G 81G 1.2G 28M 43G 42G
Swap: 979M 4.0M 975M`
为什么会这样,我如何利用这 42GB 进行计算?
top
输出:
top - 11:05:58 up 21:19, 1 user, load average: 0.24, 0.22, 0.22
Tasks: 307 total, 1 running, 201 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.6 us, 0.2 sy, 0.1 ni, 99.0 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
KiB Mem : 13170917+total, 1216824 free, 85389312 used, 45103040 buff/cache
KiB Swap: 1003516 total, 999420 free, 4096 used. 45033504 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
4292 user1 30 10 39956 5052 4272 S 2.6 0.0 0:06.94 galaxy
1171 root 20 0 488892 44216 7540 S 1.3 0.0 12:24.39 cbdaemon
5998 user1 20 0 44428 3936 3168 R 1.0 0.0 0:00.07 top
6153 user1 20 0 275740 101112 29396 S 0.7 0.1 25:55.97 nxagent
1207 root 20 0 377116 163944 68132 S 0.3 0.1 5:37.13 evl_manager
1247 root 20 0 1262092 63308 14956 S 0.3 0.0 0:35.77 mcollectived
6623 user1 20 0 126640 5852 3212 S 0.3 0.0 0:02.48 sshd
7413 user1 20 0 80.623g 0.078t 53712 S 0.3 63.8 20:14.46 rsession
1 root 20 0 225756 8928 6320 S 0.0 0.0 0:23.05 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:00.02 kthreadd
...
令人惊讶的是,问题不在 OS 或 R/RStudio 服务器上,而是在使用 data.table
时,我曾用它打开 .csv 文件。显然,它阻止了系统使用可用内存。一旦我移动到 dplyr
,我就可以毫无问题地利用系统的所有内存。