RStudio Server Preview pandoc CPU/memory leak

rstudioserver
pandoc

#1

I'm noticing frequent periods where RStudio essentially freezes when executing commands from the text editor. Watching top, I see rsession consuming gigabytes of memory and 100% cpu. After a while, the rsession name is replaced with pandoc which continues to consume 100% cpu and a constantly growing amount of memory. When I kill pandoc with pkill, the RStudio session becomes active again. I'm using rstudio-server build 1.2.1206.


#2

This was a known issue in windows systems that supposedly was fixed in that particular build (1.2.1206) by changing the pandoc version. You can try updating to the latest daily build and if you still have the same problem, consider filing an issue on github.


#3

Thanks for the advice. I will maybe see if I can change the pandoc version. I'm using Red Hat (CentOS7), by the way and didn't see any pandoc replacements there in the daily builds.

image

image


#4

In the past, we've seen this occur if Pandoc was executed without certain requisite environment variables set, but those cases should be handled now.

Any chance you can provide us with a reproducible example?


#5

I can't provide you a docker image but are there any environment variables you think would be important to look at?


#6

Here are some of the environment variables normally set by RStudio when invoking Pandoc (through rmarkdown):

Not sure if there's something similar going on here?

Do you see a similar kind of hang if you try running Pandoc from the terminal?

/usr/lib/rstudio/bin/pandoc/pandoc --help

Or from R?

system("/usr/lib/rstudio/bin/pandoc/pandoc --help")

(tweak the path to your RStudio / Pandoc installation as appropriate)


#7

Thanks for the info, Kevin.

I discovered that rstudio is using another pandoc on my path coming from some set of system libraries from anaconda. I'm thinking this might be the source of my problem. I suspect libraries from this separate set of system libraries might also be causing R package build failures and intermittently corrupted font rendering in plots besides this CPU/memory leak. I'll post back if removing these from my path resolves this.