How to determine memory usage in a shiny app?

2,790 views
Skip to first unread message

john...@operamail.com

unread,
Sep 9, 2014, 1:34:42 PM9/9/14
to shinyap...@googlegroups.com
Hello,
 I have an up on shinyapps.io and it works fine on my desktop and usually works fine on shinyapps. From time to time, however, it grays out but only on shinyapps and not in a way which I can reproduce. My thought was that this might be a issue related to memory usage. I know how to increase my memory size on shinyapps, but I don't know how to find out how much I need. Is there any way to monitor memory usage for an app? 
Thanks
 JP

Tareef Kawaf

unread,
Sep 9, 2014, 2:39:30 PM9/9/14
to john...@operamail.com, shinyap...@googlegroups.com
We are actually working on features that will expose just those types of metrics for your apps. 
The showLogs() command may show if the instance is being shutdown due to memory consumption.  
Another possibility may be that the application is going to sleep due to inactivity, is that possible?
--
You received this message because you are subscribed to the Google Groups "ShinyApps Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shinyapps-use...@googlegroups.com.
To post to this group, send email to shinyap...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shinyapps-users/2131cfb4-85f3-4c9b-80cf-e53ec5639980%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

john...@operamail.com

unread,
Sep 9, 2014, 2:48:22 PM9/9/14
to shinyap...@googlegroups.com, john...@operamail.com
I don't think that it is due to inactivity, as usually I have not been inactive more than a minute or two. What should I look for in the showLogs() output that would indicate memory?

Thanks

JP

Pieter de Wet

unread,
Sep 26, 2016, 10:53:35 AM9/26/16
to shinyapps.io Users
Hi John, Tareef,

I am wondering if my problem is related to this. I have an app which grew pretty large now, but I wanted to add another tab. However, it stopped running. No errors. I have the idea that adding the tab causes this as it has reached some sort of limit (memory, or physical?). I tried out everything, and it really looks like simply adding the tab (which also with only say 1 button or so) causes the app to stop doing it's job. Could this be related to your problem? If so, how do you set the memory larger?

kind regards,
Pieter de WEt

Joshua Spiewak

unread,
Sep 26, 2016, 12:53:04 PM9/26/16
to shinyapps.io Users
Hi Pieter,

I would suggest reading through the user guide which has sections on memory usage and changing the instance type for your application.

Usman Suleman

unread,
Sep 26, 2016, 4:10:01 PM9/26/16
to shinyapps.io Users
I have a problem which is similar to what is being discussed here.
I have a large app.  I added another tab to the navBar with the additional coding that goes with it
in ui.R and server.R.
Now - all message traffic to htmlOutput or uiOutput appears to be blocked.
No messages rendered to htmlOutput are displayed.
No dynamic widgets generated through uiOutput are being produced.
I can switch back and forth between the previous and new version and the response is as described above.
The previous version works fine.
I changed the app size from large (1 GB) to x-large (2 GB ?): Made no difference.
I went through the installed packages to see if the new version was doing something special:
Nada.
I changed the deployment scheme to not using package caching: makes no difference.
I diffed the ui and server files on GitHub to see if anything could cause this behaviour: Nada.
So what is going on?  Please help.
...Usman Suleman

Tareef Kawaf

unread,
Sep 26, 2016, 4:15:13 PM9/26/16
to Usman Suleman, shinyapps.io Users
You can see the memory footprint used by your application by visiting the shinyapps.io dashboard and taking a look at the metrics associated with the application.  As Josh points out, that should hopefully be clear in the guide.

Usman,
It is hard to tell from the description what is going on.  A few things to consider:

* Are you seeing any errors in your logs?  
* Are you seeing any errors in the javascript console?
* Is your application using a lot of memory?
* Do you have a reproducible example you could share with folks?

-Tareef

--
You received this message because you are subscribed to the Google Groups "shinyapps.io Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shinyapps-users+unsubscribe@googlegroups.com.
To post to this group, send email to shinyapps-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/shinyapps-users/e3bc4485-9d3e-4069-b995-d9a41d520e5b%40googlegroups.com.

Usman Suleman

unread,
Sep 27, 2016, 1:00:25 AM9/27/16
to shinyapps.io Users, usmans...@hotmail.com

Thank you Tareef.
Your alert guided me in the right direction.  The problem is solved.
I had made some subtle changes to the ui which got past both the native browser in RStudio and also past the (Chrome) web-browser on my
Ubuntu machine.  The problem was picked up by my (Chrome) web-browser when I deployed the app to shinyapps.io.
There were 2 problems:
1. a missing right parenthesis inside quotes.
2. using !is.null(...) in a conditionalpanel condition.  It worked with shinyapps when I changed it to ... != null

Interestingly: the same Chrome browser let these bugs past when they came from RStudio ... but not when it
came from shinyapps!

Cheers,
...Usman Suleman

To unsubscribe from this group and stop receiving emails from it, send an email to shinyapps-use...@googlegroups.com.
To post to this group, send email to shinyap...@googlegroups.com.

Pieter de Wet

unread,
Sep 27, 2016, 2:43:21 AM9/27/16
to shinyapps.io Users, usmans...@hotmail.com
That seems like the exact same problem as I have, I can not find any error in my code. When I just add a very small tab, with for instance only a button in it, this still occors. Do you have any tips/ideas for me?

Usman Suleman

unread,
Sep 27, 2016, 6:57:07 AM9/27/16
to shinyapps.io Users, usmans...@hotmail.com
Hello Pieter:
Tareef's clue alerted me to use the Inspect tool (right click on Chrome) and I could see error messages in the console window.  You could try that.
Or post a gist or code fragment that others can look at?
...Usman Suleman
Reply all
Reply to author
Forward
0 new messages