Repeated postMessage calls to Native Client module passing in ArrayBuffer causes excessive use of swap space
Reported by
tu...@screenleap.com,
Apr 3 2016
|
|||||||||||||
Issue description
UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2698.0 Safari/537.36
Steps to reproduce the problem:
1. Create the array buffer for a canvas (i.e. var buf = canvas.getContext('2d').getImageData(0, 0, width, height).data.buffer).
2. Pass the array buffer to the Native Client module using postMessage (i.e. naCl.postMessage({buffer: buf});
3. Do this repeatedly every few seconds.
What is the expected behavior?
The amount of swap space used by the Native Client should not keep increasing. Either the space should be reused or cleaned up after usage.
What went wrong?
If you look in the swap file area (/var/vm for Mac), you see that additional 1GB swap files will be created about once a minute. The available disk space will run out. It's faster for computers like Chromebooks that does not have as much disk space.
Once the available disk space runs out, Chrome locks up and needs to be forced restarted.
Did this work before? No
Chrome version: 51.0.2698.0 Channel: stable
OS Version: OS X 10.11.3
Flash Version: Shockwave Flash 21.0 r0
We need to frequently send image data to our Native Client module for processing and then return the processed data. We are unable to because the swap space that is used for passing the data is not being cleaned up or not being cleaned up in a timely manner.
,
Apr 4 2016
Could you please provide us with a sample test case/ HTML file to reproduce the issue from test team end.
,
Apr 4 2016
,
Apr 4 2016
Please find attached the test Chrome extension with the compile NaCl.pexe that you can install by dragging to chrome://extensions. The extension will run as soon as installed. If you then go to http://www.youtube.com and start playing a video, you will start seeing additional swap files appear every 10 minutes. It seems like the swap file increases with the image from which the arraybuffer is created changes. If you post to the Native Client module with the same arraybuffer, then the swap space doesn't increase. It only increases if the image data differs.
,
Apr 5 2016
Thank you for providing more feedback. Adding requester "tkonchada@chromium.org" for another review and adding "Needs-Review" label for tracking. For more details visit https://sites.google.com/a/chromium.org/dev/issue-tracking/autotriage - Your friendly Sheriffbot
,
Apr 22 2016
,
Apr 25 2016
Tested the same on mac 10.11 chrome version 51.0.2704.19 and canary - On adding the extension and playing a video in youtube the background.html of the extension displayed the console output with unchecked runtime errors as shown in the screenshot. tuyen@, Could you please let us know if this is the error you are getting. A screenshot/screencast would be much helpful for further debugging.
,
Apr 27 2016
The "Failed to capture tab: unknown error" is what you get when you have the dev console open since Chrome is not allowed to capture special pages like the dev console.
,
Apr 27 2016
Thank you for providing more feedback. Adding requester "tkonchada@chromium.org" for another review and adding "Needs-Review" label for tracking. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Apr 28 2016
Tested the same on mac 10.11 chrome version 51.0.2704.29 and canary - On adding the extension and playing a video in youtube the background.html of the extension displayed the console output as shown in the screenshot. The swap file stored in /private/var/vm/ is sleepimage - please find the screenhot of the terminal output tuyen@, Please let us know if i am missing something here in reproducing the issue. A screencast would be more helpful.
,
Apr 28 2016
,
May 13 2016
If looks like the issue is that ArrayBuffers larger than 256K are passed to the Native Client using shared memory: https://bugs.chromium.org/p/chromium/issues/detail?id=147597#c22 Do you know when that memory gets freed? Is it possible if you are sending data via ArrayBuffers at a high rate, there is not time for cleanup?
,
May 14 2016
Thank you for providing more feedback. Adding requester "tkonchada@chromium.org" for another review and adding "Needs-Review" label for tracking. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
May 16 2016
teravest@, Would you mind responding as per comment #12
,
May 26 2016
Removing Needs-Bisect for now. Please add the label if required teravest@, Gentle Ping!!! Could you please respond as per comment #12
,
Jun 27 2016
teravest@ : Could you please take a look into this and update according to Comment # 12.
,
Aug 10 2016
Due to lack of user response we are closing this issue for now. Please feel free to file a new issue if you come across this issue again. |
|||||||||||||
►
Sign in to add a comment |
|||||||||||||
Comment 1 by tu...@screenleap.com
, Apr 3 2016