RStudio Showing Little Memory After Clearing Global Environment

Hello all. I've been working in RStudio for years just fine, but I have an issue that is stumping me. I'm running out of memory which is causing RStudio to abort when running simple functions. I know, I know, clean the global environment, garbage collect, and then it should be good... I did that and it didn't help at all, my system's memory is still nearly maxed out. When I look at the memory report, it shows that over 75% of the available memory is being used by the system. I'm at a loss to explain why this is the case. I've attached a couple pictures below. I've also tried exiting out of all my scripts that were loaded in, cleaning, and restarting, but to no avail. Any thoughts/ideas appreciated. Thanks

image
image
image

If it says the memory is used by the system then this has nothing to do with R or RStudio but with your Windows system. Use the Windows' task manager to find out which process is hogging your memory.

Thanks for the response. Here's a screenshot of task manager:

It looks like "QT Qtwebengineprocess" is taking up 52.6 mb which is quite a bit. Any idea what that process does or how to disable it?

That's the "browser" on which RStudio is built and 53MB is pretty small, particularly when you have nearly 1GB in your Chrome session.

I agree with Martin, even if QT is used for your RStudio session, the memory it consumes is negligible compared to the 6GB the rest of processes are using in your system. I think you should look for in-person tech support since this is specific to your particular system's configuration and has nothing to do with R, RStudio or data science (the topics of this forum).

1 Like

I understand. My question then is: how do I allocate more memory for RStudio to use? I can add memory each session using memory.limit(), but how can I make it so I don't have to do this every time?

On my Windows system memory.limit() reports a warning message that
'memory.limit()' is no longer supported

Not very helpful, I know.

Since you have only about 1 GB free, you can about double what's available by shutting down Chrome. You may need to shut it down in the task manager as sometimes just closing the Chrome window leaves pieces running. Past that, 8GB of memory is kind of light for doing heavy duty number crunching so consider whether adding more memory is worth it to save your time.

Also not very helpful, I know.

1 Like

This doesn't add (or preallocate) any memory to RStudio, by default, this is set to the total amount of RAM memory installed in your system so R will always use the amount of memory that is available (free) at any particular moment.

If you want to free some memory, simply close the other software you are not currently using or buy more memory.

2 Likes

Thank you all so very much for your help. It is greatly appreciated.

Hi all. Sorry to keep pestering you with RStudio memory questions, but this morning RStudio was the first thing that I booted up. No other programs were running, not even chrome. I would've expected R to preallocate more memory, but it still allocated the same as it did yesterday when I had the other programs taking up a bunch of RAM. Any ideas on this? Thanks again for your help.

R does not preallocate any memory it simply uses as much as it needs and is available at any given moment. This is the common behavior for software of any kind.

Some programs open at boot automatically on the background so even if you have not started anything manually, they could still be using a lot of memory. Nothing of this is fixable from the R/RStudio side of things, you need to setup your machine properly, that is why I advised you to look for tech support.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.