Diagnosing a non-responsive RStudio console


I experience a strange, difficult-to-reproduce issue where code entered at the console occasionally takes a long time to be evaluated. For example > 1 <enter> would take about a minute. I notice it is more likely to happen after I have tried to query the file system, e.g. dir(path = "~/some-dir-with-lots-of-files/<tab>"). Neither other programs, nor other parts of RStudio freeze or are even slower (I can access the menus just fine). The :stop_sign: icon at the top right of the console is generally not illuminated during the lengthy delay.

I consulted the log files rdesktop.log, rsession-hugh.log but none had entries that were concurrent with this pause.

When I hit Request Log, I see a large blue stripe with labelled get_completions and console_input, but couldn’t see anything more than what I’ve described (I can’t copy it).

Is this a known issue. If a fix is warranted, what should I do to diagnose it in order to improve RStudio in future versions?

RStudio Version 1.1.419 on Windows 10


Hi @hughparsonage, I wonder if this may something to do with you Virus protection. Can you run some experiments with it off?


Hi, thanks. It occurs with virus protection off too.


I’ve come across the same issue, with RStudio Version 1.1.419 (and several previous versions) on Windows 10. The slowdown seems to only occur when accessing a file on a network drive. Typically, the RStudio console hangs for 1-3 minutes.

.libPaths(c("somenetworkpath", .libPaths()))

I should mention I am unable to turn off the virus protection on the computer where this occurs.


We’ve definitely seen issues of this form when using RStudio on Windows with networked drives (especially when using an R library that itself lives on a networked drive). We did make a few improvements around the handling of these cases in v1.1.419, but it sounds like there is more for us to do.

We’ll see if we can replicate these slowdowns ourselves and alleviate the issue!


Thanks! Just to clarify, for me the issue does not appear exclusively on network drives (indeed my computer does not connect to any as far as I know), but does appear to be more likely to occur when accessing folders with a large number of files.


@hughparsonage: Sorry to be coming back to this so late, but is there any chance this could be related?

If you have Windows Defender running, can you try disabling it temporarily to see if that helps?


Hi Kevin, no apology necessary at all. However, that did not resolve the problem: I’m running Kaspersky but with that off I could still reproduce the problem.


Does disabling automatic code completions help here? It’s possible that RStudio’s attempts to autocomplete file names, e.g. when typing within strings, is causing an overly expensive filesystem operation in your case:

I’m also curious whether (as you said in the original post) the slowness could indeed be attributed to attempts to list files on a networked drive. What is the output of, for example:


Do your R packages live on a networked filesystem? If so, you might also want to see how long it takes to query the set of installed packages:


Hopefully this will get us closer to the underlying issue.


(Note that, as I’m sure you know, list.dirs uses recursive = TRUE.)


   user  system elapsed 
   3.75   12.93   76.90

   user  system elapsed 
  10.60  102.04  260.80 

   user  system elapsed 
   0.24    0.18    0.40


   user  system elapsed 
   3.88    1.28    5.19 

   user  system elapsed 
   8.47   63.15   71.79 

   user  system elapsed 
   0.18    0.20    0.38 


Strange that it takes so much longer within RStudio! One more thing I’ll ask you to try – does the issue subside if you disable indexing for that project? Within Tools -> Project Options...:

If you disable the checkbox saying:

  • [ ] Index source files (for code search/navigation)

does the issue subside at all? (You might need to restart RStudio after changing this preference.)


Mixed results that probably require your interpretation:

Unchecking index source files then restarting resulted in basically the same times for RStudio as I got for Rgui.exe . :white_check_mark:

One possible caveat: in my previous post where I got 76.90s for list.files() I ran those timings at the end of the day (i.e. after RStudio had been up and running for a while) whereas these timings are first thing in the morning. When I rechecked index source files, restarted RStudio, and timed again, the timings remained around 5s for list.files(), suggesting it wasn’t to blame. Of course, if the indexing occurs between sessions and unchecking discards the index then this may indeed be the solution.


RStudio will begin indexing a project immediately after RStudio is launched, so if the project indexer were the culprit, I would expect the slowness to manifest immediately after launching RStudio and perhaps subside after the project indexer has finished running.

It’s interesting that the sum of user and system timings is typically less than elapsed timings for RStudio’s case. I think this implies that RStudio is doing work behind the scenes that R is not capturing; the project indexer is one such thing that could be implicated here, but it could also be e.g. a long-running old completion request that inadvertently caused a listing of files in the filesystem.

Would you be willing to also provide a screenshot of the event log in the case where the R session is getting stuck? In particular, I’d like to see what the event log looks like immediately after the console prompt finally shows up.

As a side note, after showing the request log (with Ctrl + `), you can press e to get a JSON representation of the event log, which you could then share with us so we could see exactly what requests were being made to the R session. (You could copy the JSON to a file, and then upload it somewhere we could take a look.)


OK I’m getting good at reproducing:


I’ve emailed you the JSON of the event log to your rstudio address. Let me know if you don’t get it. My email is just my username at gmail.com



Just want to chime in that I’m experiencing the same problem using RStudio on a network file system. I’ve tried changing the HOME directory to a local path and adding exclusions for R .exe files to Windows Defender with no luck. If anyone cracks this problem please let us know as the random relays in executing simple line of code make it hard to make progress. Thanks!