I'm trying to increase the maximum memory limit as I keep running into this error: cannot allocate vector of size 4Gbs.
memory.limit() reports that I have 8067Mbs of RAM.
memory.size(max=TRUE) indicates that only 1525.75 of RAM is obtained.
memory.size(max=FALSE) indicates that I'm only using 1491.41 of RAM.
If the memory limit is 8.67 Gbs of RAM, why is it that only 1525.75 of RAM is obtained?
The first thing to do is start from a fresh session. If many things have been run in an interactive session then sometimes memory does not get released and such an error can occur.
I don't think this actually reports the amount of RAM. (Mine reports I have 16TB available on my laptop which I most certainly don't!)
You could see whether you get the same outcome if you run it in R (outside RStudio).
Interestingly enough, in R, memory.limit(size=) does not allow for size beyond 4000MB, where in RStudio, memory.limit(size=) could be set to any limit.
R and RStudio memory usage documentation is surprisingly awful. Apparently you need to set a command line parameter but I can't find how to do this?
I did some experiments. I have 24Gb physical RAM, Windows 10 64 bit. It's instructive to open the Windows Task Manager and watch the memory usage as you do this. It looks like I can use most of my physical memory without changing any settings or command line arguments. If I push it even further R/RStudio seems to start using the disk to store stuff, or just says no.
My computer does not have Services for Unix, thus I'm not able to carry out the rest of the steps. I think it has to be installed through a CD-Rom, which I do not have. Thanks for the help though!
So I tried to plot the graph again with Task Manager opened. Memory usage for RStudio during the analysis is low to moderate. After around 15 seconds I get Error: cannot allocate vector size 4GB. It seems like RStudio isn't even trying to obtain more memory from Windows to generate the plot.
Would my best luck be to simply find a more powerful computer?
The command line is just a quick way to check. The IBM link tells how to change ulimit in the registry, assuming that you have the requisite privileges and are comfortable with registry editing. All the additional RAM that can fit in your computer won't help if the operating system won't allow you to use more than a pre-set limit.
I'm not familiar with the registry. The IBM link says to increase the "maxOpenFiles" by navigating to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Services for Unix. However, my computer does not have "Services for Unix" under "Microsoft". How should I proceed? Which command line are you referring to?