voltrb - The volt view never releases memory -


a beginner volt question here :-).

i’ve created simple volt app pulls random images file system - slide show. image data retrieved in server task (in addition file path, want dimensions orientation etc, use ruby library) , passed main controller. have method (get_random_pic) in controller sets img path etc on page img tag use in view:

<img width="{{page._image_data[3]}}}}" src="{{page._image_data[0]}}">image</img> 

(an aside: using array in effort value binding "signals" arrive @ same time - otherwise image width updates @ different time image path - still not synchronous array)

then use settimeout in controller call get_random_pic method again (via button).

settimeout(function(){ document.getelementbyid("mybutton").click(); }, 5000);

this works memory usage never stops growing (e.g. after 20min 2gb). assume because each time image being loaded in view, previous image orphaned , gc can’t run. don’t know enough js come intelligent reasons why, nor elegant work around. maybe load image in controller instance method , img tag references directly binary (rather pull via file path file system), , on each iteration set nil, i’m hoping there nicer solution, before try that.


Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

android - Keyboard hides my half of edit-text and button below it even in scroll view -

css - Make div keyboard-scrollable in jQuery Mobile? -