benhull
Posts: 8
Joined: Thu Dec 31, 2015 6:27 pm

Experiencing memory leak in KWEB3 playing HTML5 videos

Sat Jan 02, 2016 9:10 pm

If anyone can help me, I'd be very grateful.

We have built a single page app in html / css / javascript (angular), which loads and plays videos.

We have found KWEB3 provides the best experience, but we have a problem where the videos, after playing, are not being removed from the virtual memory. After playing the 8th or 9th video, the play back fails. It occurs just as the VM-Size of the app reaches just under 1000MB.

Can anyone help with how to solve this issue?

Thanks in advance.

benhull
Posts: 8
Joined: Thu Dec 31, 2015 6:27 pm

Re: Experiencing memory leak in KWEB3 playing HTML5 videos

Sat Jan 02, 2016 10:20 pm

Further info: this error appears in terminal if kweb3 was launched from there:
AL lib: alsa_open_playback: Could not open playback device 'default': Device or resource busy

gkreidl
Posts: 6335
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Experiencing memory leak in KWEB3 playing HTML5 videos

Sun Jan 03, 2016 7:46 am

The same problem should happen with epiphany, as both programs are using the same webkit engine.

I believe, that the problems you have are caused by the way you handle the videos in your Javascript application. The browser seems to "believe" that all videos are part of the current page and so tries to assemble them in (virtual) memory.
I don't know if a solution can be found within the Javascript code (rarely use it), but perhaps by a design change. A simple solution that comes to my mind: run the videos inside an iframe and manipulate it's src attribute. Then the browser would load a new page (frame) whenever a new video starts. This might help to "forget" the old videos.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

benhull
Posts: 8
Joined: Thu Dec 31, 2015 6:27 pm

Re: Experiencing memory leak in KWEB3 playing HTML5 videos

Mon Feb 08, 2016 1:39 pm

@gkreidl thank you so much for your suggestion. This resolved the issue completely. I spent days trying to resolve it other ways and this solution saved the day!

Thanks again.

Return to “Graphics, sound and multimedia”