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

Issue 683422 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Last visit > 30 days ago
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug



Sign in to add a comment

blob filled, chrome crash

Reported by lemarier...@gmail.com, Jan 21 2017

Issue description

Chrome Version       : 57.0.2987.3
OS Version: 6.1 (Windows 7)
URLs (if applicable) :
Other browsers tested:
  Add OK or FAIL after other browsers where you have tested this issue:
     Safari 5: unknown
  Firefox 4.x: OK
     IE 7/8/9: unkonwn

What steps will reproduce the problem?
 running this js piece of code

var b = new Blob([new Uint8Array(700*1024*1024)], {type: 'application/octet-string'});
var reader = new FileReader();
reader.onload = function(event) {
  console.log("got load event", event);
}
reader.onerror = function(event) {
    console.log("got error", event);
}
reader.readAsArrayBuffer(b);



What is the expected result?
blob gets filled

What happens instead of that?
chrome crash


Please provide any additional information below. Attach a screenshot if
possible.
my computer config
WIN7 x32
3GB RAM
total disk 120GB and 20GB free disk space

UserAgentString: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.3 Safari/537.36


****DO NOT CHANGE BELOW THIS LINE****
Crash ID: crash/6bbffe0880000000
 
bug.jpg
70.4 KB View Download

Comment 1 by dmu...@chromium.org, Jan 21 2017

Cc: dmu...@chromium.org
Labels: Needs-Feedback
It looks like the error says the tab is out of memory? I'm guessing you're hitting the memory limit of the tab in Javascript.

If you simply do:

var array = new Uint8Array(700*1024*1024);

I'm guessing it will also crash?

If this is the case and you need to create large blobs, I suggest you chunk your data into smaller sizes. After you've created all of your small blobs, you can combine them into one big blob.


var b1 = new Blob([new Uint8Array(10 * 1024*1024)], {type: 'application/octet-string'});
var b2 = new Blob([new Uint8Array(10 * 1024*1024)], {type: 'application/octet-string'});
...


then 
var bigBlob = new Blob([b1, b2, b3, etc],  {type: 'application/octet-string'});

Although maybe you won't need to combine them. I would be careful to create the blobs too quickly, as the renderer temporarily holds the blob memory while it is sending it to the browser.

If you want to avoid 'holding' memory, you can make your blobs < 250KB, which means that they will usually fit in an IPC and not hold the memory. Not always the case if the blob system is paging items to disk or if the quota is full.

Does that make sense?

Comment 2 by dmu...@chromium.org, Jan 21 2017

I'm adding an explainer for the blob system if you want to learn about the limits and how it works. It's not submitted yet, but you can view it here:
https://codereview.chromium.org/2637023003/
(https://codereview.chromium.org/2637023003/diff/60001/storage/browser/blob/README.md)

Sorry for the lack of good rendering of markdown - you can copy paste into a markdown viewer.
Components: Blink>Storage
Labels: Needs-Triage-M57

Comment 5 by pwnall@chromium.org, Jan 24 2017

Cc: pwnall@chromium.org jsb...@chromium.org
dmurph: Would it makes sense for us to work with devrel and come up with some reasonable guidelines for developers who need to handle large blobs?

I'm not too thrilled about implementation details such as our IPC size leaking into the Web.

Comment 6 by pwnall@chromium.org, Jan 24 2017

Labels: -Needs-Triage-M57
Owner: tjsavage@chromium.org
Status: Assigned (was: Unconfirmed)
tjsavage: Can you please help us find someone to work with here?

Comment 7 by dmu...@chromium.org, Jan 30 2017

I think this could use a best practices doc, definitely. I'm willing to help here / type up when I think, I just don't know the devrel practices.
I think as a start this guidance could live here:

https://developers.google.com/web/fundamentals/instant-and-offline/web-storage/

which can be edited here:

https://github.com/google/WebFundamentals/tree/master/src/content/en/fundamentals/instant-and-offline/web-storage

dmurph: If you'd be willing to add some best practices, I think a pull request to that repo would be greatly appreciated.


Sign in to add a comment