4

I have 64Gb of RAM on my Windows 10 PC, but Chrome crashes after using 4Gb of RAM due to decoding multiple large MP3 files with decodeAudioData.

Here is example of page that will crash after several minutes of loading MP3 files: http://artportal.su/ctools/job.php?j_id=55766&tab=multitrack

Here is example of page that will not crash due to smaller files: http://artportal.su/ctools/job.php?j_id=55791&tab=multitrack

Here is the code:

loader.context.decodeAudioData(
  request.response,
  function(buffer) {
    if (!buffer) {
      alert('error decoding file data: ' + url);
      return;
    }
    loader.bufferList[index] = buffer;
  },
  function(error) {
    console.error('decodeAudioData error', error);
  }
);
Rualark
  • 445
  • 1
  • 5
  • 18
  • You might be hitting your memory limit. See https://stackoverflow.com/questions/17491022/max-memory-usage-of-a-chrome-process-tab-how-do-i-increase-it `"C:\Program Files\Google\Chrome\Application\chrome.exe" --max_old_space_size=8192` – Tschallacka Mar 01 '19 at 11:56
  • Just found a thing in a 9 year old commit that it might also be `--js-flags="--max-old-space-size=8192"` https://bugs.chromium.org/p/v8/issues/detail?id=847 – Tschallacka Mar 01 '19 at 12:03
  • 1
    @Tschallacka thank you for your suggestion. Does it fix this issue in your browser? For me it does not: `"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --max_old_space_size=8192 --js-flags="--max-old-space-size=8192"` – Rualark Mar 01 '19 at 12:24
  • No, sadly not. But if you read that chromium thread you can see there are a lot of issues going hand in hand with using a lot of memory. Hardcoded limits, integer limits, etc... On other systems that still run 32 bit your browser might even crash earlier. You should try to load less data as not to take up as much space. Try to implement streaming, where you can seek from and to a point you need to play so you don't need to keep the massive MP3 in memory. You would need to rely on an adequate connection though. simultaneous connection limit seems to be 5 ish. Perhaps a serverside mixing? – Tschallacka Mar 01 '19 at 12:27
  • that is an interesting thing! but Chrome developers say that they won't fix that, I am not sure if it's not connected to OS structure overall, as I get the same problem when trying to load SENTINEL 1 (satellite) image that uses more than 4GB, it just says that I run out of memory (and to close some other applications), even when there is like a lot of free ram (not reserved by OS), I know that games are using much more, but still... maybe it's some limit per task or something? pretty weird thing – Flash Thunder Mar 01 '19 at 12:32
  • maybe it has something to do with page file size? – Flash Thunder Mar 01 '19 at 12:38
  • 1
    Actually, `--no-sandbox` parameter helped, but this is not secure. Is there a better way? – Rualark Mar 01 '19 at 12:41

0 Answers0