shiny-server never release browser's memory.

713 views
Skip to first unread message

Huidong TIAN

unread,
Dec 31, 2013, 3:59:47 AM12/31/13
to shiny-...@googlegroups.com
Hi, 
  I never realized this problem until yesterday. My application getting slower and slower and finally unresponsive.   Due to my application contain huge dataset, I take "02_text" from 'shiny' package as an example:
  1.  runExample("02_text")
  2. press "shift + Esc" to call up Chrome task manager.
  3. keep changing the input value and monitor the memory of 'Tab: Shiny Text'.
we can see that memory keep increase. If we have an application dealing with large data, the memory can easily increase to 1GB, and then unresponsive. Same problem found in Firefox browser. 

Any body can suggest some resolution. 

Regards!

Huidong.

Joe Cheng

unread,
Jan 1, 2014, 6:16:27 PM1/1/14
to Huidong TIAN, shiny-...@googlegroups.com
With 02_text when I run it with the Chrome Developer Tools memory profiler, I don't see strong evidence of a memory leak. If you show the Chrome Task Manager and right-click to show the JavaScript memory column, you will see that the "live" memory goes up and down as the garbage collector does its work. I believe the fact that the overall tab memory goes up slowly and then dramatically down once in a while (mine climbed up to 75MB before plunging to 50MB) is also due to the way garbage collection works in Chrome.

Are you sure that your application getting slower and slower is due to memory exhaustion in the browser? That would be quite surprising to me. Do you have a URL we can look at?


--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Message has been deleted

Huidong TIAN

unread,
Jan 2, 2014, 3:38:42 AM1/2/14
to shiny-...@googlegroups.com, Huidong TIAN
Hi Joe, 
  Thanks for your reply!
  Here I deploy my app on http://spark.rstudio.com/withr/loopShow/. Please click on the play button at the left-top corner to start the application.
  The aim of the app is to show some data processing repeatedly. I use sliderInput with loop animation to trigger the change between tabs. You can see the JavaScript memory keep increase, easily to 200 Mb in two minutes. And I need the application run day and night, so it's easy to get chrome memory increase to 1GB, if all the memory of my computer were used, then the computer stack. 

  I feel it's possible to use JavaScript to change the tabs to show, maybe that will solve the current problem, but I also need import new data to my application everyday, and I guess the problem will stay. 

  Any suggestion are high appreciated. 

Huidong

Joe Cheng

unread,
Jan 6, 2014, 2:21:05 PM1/6/14
to Huidong TIAN, shiny-...@googlegroups.com
It would be really really helpful if I could run the app myself--or even better, a minimal example with the highcharts and datatables and tabs setup that you have. Would that be possible?

Willi Fiebranz

unread,
Oct 16, 2014, 7:09:37 AM10/16/14
to shiny-...@googlegroups.com, tienh...@gmail.com
Hi, I have a quite similar problem recently. Have you found a solution during the last 9 months? Would be much appreciated!

Best

Huidong TIAN

unread,
Oct 16, 2014, 7:11:54 AM10/16/14
to Willi Fiebranz, shiny-...@googlegroups.com
No, I didn't :-(

Willi Fiebranz

unread,
Oct 16, 2014, 7:23:08 AM10/16/14
to shiny-...@googlegroups.com, willi.f...@gmail.com
Quick response :)

I try to track down the problem, so maybe by comparing our approaches, we get a bit wiser:

I marked every singe reactive and UI element with a print feedback, so I am sure that nothing happens except checking a checkbox an putting the value into a (big) reactiveValue list.
And the I have a memory leak of around 100 mb. I could also find out, that the memory location changes, and it is probably because that the old copy is not released in the observer/reactive context, that the leak occurs. 

Here is the deal: I tried to replicate a minimal example for Joe, but while following pretty much the same logic like my original app, the leak does not occur.

I wonder now, that it might occurs, because I stored my dataset as a reactive function, in the sense that a call of the reactive function "file()" gives me a data.frame.
Did you maybe follow a similar approach handling your uploaded data?

Best

Willi Fiebranz

unread,
Oct 20, 2014, 3:51:51 AM10/20/14
to shiny-...@googlegroups.com, willi.f...@gmail.com
Hi,

I found the cause of my memory leak, so if you interested if this might relate to your code, check it out here:


Best
Reply all
Reply to author
Forward
0 new messages