Re: [firebreath-dev] extension scriptPort.postMessage(msg) consumes massive amount of memory in-case of large video buffers.

24 views
Skip to first unread message

Richard Bateman

unread,
Oct 5, 2018, 1:01:07 PM10/5/18
to FireBreath Dev Group
Hi Veerendra,

Unfortunately the path required to get form the page to the firebreath plugin and back requires something like 4 layers of message passing; the one you're referring to is the one that passes it from the background script to the content script (which then passes it to the page via another postMessage this time on the window). I do not know of any other way to get the information to where it is needed.

You could plausibly update the protocol to support some special datatype which would be encoded as base64 but decoded in the background script and passed the rest of the way as an ArrayBuffer -- that would reduce the memory footprint of each message since it wouldn't be making so many copies of the base64 data. I'm not sure what else to suggest.

Richard

On Fri, Oct 5, 2018 at 5:12 AM <veerendr...@motorolasolutions.com> wrote:
Hi,

We are playing a video in UI layer using YUV raw data, the data(per second 15 frames of base64 encoded string format) which comes from plugin layer via Firebreath extension using callback method. 

Looks like before passing it to UI layer the data is getting stored in browser memory and after it reaches 100% usage of CPU Memory browser is crashing.

We are suspecting that below mentioned code might holding the buffers and creating memory issues  from the background.js file.

Reference: 

 hostPort.onMessage.addListener(function(msg) {
        // Message from the native message host,
        // post it to the content script (to the page)
        scriptPort.postMessage(msg);
    });

Please Guide us if you find out the problem.

Thanks & Regards,
Veerendra

--

---
You received this message because you are subscribed to the Google Groups "firebreath-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebreath-de...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages