New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 600183 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

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.
 
From my testing, this seems to happen also when frequently posting any message to the Native Client module, even if not passing a large array buffer. It's just that the swap space increases more slowly if passing less data.
Cc: tkonch...@chromium.org
Labels: Needs-Feedback
Could you please provide us with a sample test case/ HTML file to reproduce the issue from test team end.
Components: Platform>NaCl
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.

nacl_test.zip
52.5 KB Download
Project Member

Comment 5 by sheriffbot@chromium.org, Apr 5 2016

Labels: -Needs-Feedback Needs-Review
Owner: tkonch...@chromium.org
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
Labels: -Needs-Review Needs-Bisect
Labels: Needs-Feedback
Owner: ----
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.
Screen Shot 2016-04-25 at 11.45.06 AM.png
263 KB View Download
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.
Project Member

Comment 9 by sheriffbot@chromium.org, Apr 27 2016

Labels: -Needs-Feedback Needs-Review
Owner: tkonch...@chromium.org
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
Labels: -Needs-Review Needs-Feedback
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.


Screen Shot 2016-04-28 at 11.17.42 AM.png
86.9 KB View Download
Screen Shot 2016-04-28 at 11.31.03 AM.png
45.1 KB View Download
Owner: ----
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?
Project Member

Comment 13 by sheriffbot@chromium.org, May 14 2016

Labels: -Needs-Feedback Needs-Review
Owner: tkonch...@chromium.org
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
Cc: teravest@chromium.org
Labels: -Needs-Review Needs-Feedback
Owner: ----
teravest@, Would you mind responding as per comment #12
Labels: -Needs-Bisect
Removing Needs-Bisect for now. Please add the label if required

teravest@, Gentle Ping!!!

Could you please respond as per comment #12
teravest@ : Could you please take a look into this and update according to Comment # 12.
Cc: kavvaru@chromium.org manoranj...@chromium.org rnimmagadda@chromium.org durga.behera@chromium.org
Labels: -Needs-Feedback
Status: WontFix (was: Unconfirmed)
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