如何在 R 中获取系统 (Windows) 内存?

How to get system (Windows) memory in R?

有谁知道如何从R获取系统使用的内存(RAM)?

我正在使用 windows。 memory.size()mem_used() 函数分别给出 R 和 R 对象使用的内存,但它们没有考虑系统和其他软件已经占用的内存。

这是在 Windows 上使用 shell 的一种方法:

shell('systeminfo | findstr Memory')
#Total Physical Memory:     16,271 MB
#Available Physical Memory: 8,011 MB
#Virtual Memory: Max Size:  32,655 MB
#Virtual Memory: Available: 24,040 MB
#Virtual Memory: In Use:    8,615 MB

如果您想要更精细的结果,您可以使用不同的字符串而不是内存。