RStudio hangs upon exit and frequently just stops mid process, root folder needs deleting after every use.

I've recently been issued with a new laptop by my company. I promptly download the latest version of the RStudio IDE and R.

R installed just fine to the default folder, I had to use the Zip folder for RStudio due to the non admin install issue.

The packages for my processes were auto installed and all seemed fine.

I looked to run a fairly chunky process that takes in SQL data and transforms and this is where I ran into my first issue.

The console reflected that I'd run a command, however the "stop" button never materialised. Instead a green icon next to where the stop button is usually running advised that a "a child process is running". After 30 minutes I force quit RStudio and tried again.

This time the IDE loaded, but when I tried to run the script, RStudio just sat there. No stop process button, no Green icon telling me about a child process. The console showed the first command, but nothing else.

I force closed again and deleted the localappdata RStudio folder. Upon doing this RStudio managed to run the process, but when I tried to quit R is just sat there spinning telling me that it was closing. In the end I had to force quit and now I find myself in a constant loop of having to kill off the localappdata folder to have any chance of getting an RStudio script to run.

I've tried installing an older version of R along with an older version of the IDE, no dice, same issue.

I'm pulling my hair out here, I use RStudio multiple times every single day. I just cannot work out what is wrong.

I'm running the latest version of Windows 11, the laptop has 32GB of Ram and a Core i9 CPU. Any advice on how to work out what is causing this issue would be greatly appreciated.

Other colleagues using the same hardware and software combination are not having my problems.

A longshot, but one thing which comes to mind is whether OneDrive is messing things up by trying to sync all your data.

I previously avoided OneDrive until a new laptop with much smaller storage meant I had to use it. Occasionally it appears to cause some issues using RStudio, but nothing as bad as you are experiencing.

Also check that you have switched off restoring/saving the Workspace (.RData) in the Global Options menu which is generally good practice. This doesn't appear related to the issue you've described though.

One Drive is a new part of our software. I'll look to temporarily kill that to see if it resolves the issue. I should have mentioned, but I did kill off the restoring/saving workspace after exit.

*** Edit - over a few days of testing I can confirm that OneDrive is the issue. I now disable it automatically and only allow it back on once a week. ***