无法在Quantreg中使用RAM内存 [英] Unable to use RAM memory in quantreg

查看:124
本文介绍了无法在Quantreg中使用RAM内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在12 555 029个案例中使用2个独立变量运行quantreg. 我在64位操作系统的计算机上有16GB的RAM. 命令memory.limit()返回了 16 264 . 命令sessionInfo()返回:

I'm trying to run quantreg with 2 independent variables over the 12 555 029 cases. I have 16GB RAM on computer, 64Bit OS. Command memory.limit() returned 16 264. Command sessionInfo() returned:

R version 3.5.2 (2018-12-20)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default

locale:
[1] LC_COLLATE=English_United Kingdom.1252  LC_CTYPE=English_United Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.5.2 tools_3.5.2   

在执行quantreg期间,最多只能使用 4GB .我在任务管理器中看到了这一点.尚未完成一个多小时,我停止了它.

During the execution of quantreg only up to 4GB is used. I saw this in task manager. It is not finished for more than one hour and I stopped it.

为什么quantreg没有使用其他可用的RAM?如何增加RAM内存的使用量?

Why quantreg is not using other RAM available? How I can increase using of RAM memory?

推荐答案

R无法使用系统上可用的所有RAM.有一些技巧可以克服R中有限的RAM问题.R将所有数据存储在RAM上,因此这就是可以分析数据大小限于RAM数量的原因.我们应该做的是减少数据大小,选择更有效的数据类型,以及克服此问题的一些技巧.

R cannot use the all RAM available on your system. There are some tricks to overcome limited RAM issue in R. R stores all data on the RAM so this is why the size of the data can be analyzed is limited to the amount of the RAM. What we should do is to reduce the size of the data and choose more efficient data types and some tricks to overcome this problem.

1-根据数据的类型,您可以更改其类型.例如,数字值比整数占用更多的内存.

1 - Depends on the type of your data, you may change it's type. For instance, numeric values take more memory than integers.

2-尽可能使用因子而不是字符.因子更有效,因为它们存储级别而不是整个向量.

2 - Use factors instead of characters where it is possible. Factors are more efficient because they store the levels instead of the whole vector.

3-如果您有任何没有NA值的逻辑变量,请使用位向量.它们仅占1位,而逻辑变量占4至32位.

3 - Use bit vectors if you have any logical variable without NA value. They take up only 1 bit while logical variables take 4 to 32 bits.

4-重用对象而不是在可能的情况下创建新对象,并确保在删除某些对象时调用gc().

4 - Reuse your objects instead of creating new ones where it is possible and make sure that you call gc() when you delete some objects.

5-您可以保存大数据,将其删除并在必要时重新加载.

5 - You can save your big sized data, delete it and reload it when it is necessary.

6-看一下bigmemoryff软件包.

6 - Have a look at bigmemory and ff packages.

7-关闭系统上的所有其他进程,因为它们占用了一定数量的RAM.

7 - Close all other processes on your system because they are taking some amount of your RAM.

您可以看一看Lim和Tjhi撰写的名为"R High Performance Programming"的书.

And you can have a look at the book titled 'R High Performance Programming' by Lim and Tjhi.

希望有帮助.

这篇关于无法在Quantreg中使用RAM内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆