Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashing on large file size #6

Open
nakedsushi opened this issue Nov 3, 2016 · 5 comments
Open

Crashing on large file size #6

nakedsushi opened this issue Nov 3, 2016 · 5 comments

Comments

@nakedsushi
Copy link

nakedsushi commented Nov 3, 2016

I tried running a large wav file (almost 600M) through flac.js, but it keeps crashing w/ the Chrome "Aw Snap" error message around 49%. Is there another solution for working with large files?

chrome debug log:

<--- Last few GCs --->

   75225 ms: Scavenge 1339.1 (1349.4) -> 1337.1 (1349.4) MB, 0.1 / 0.0 ms (+ 0.6 ms in 32 steps since last GC) [allocation failure].
   75864 ms: Scavenge 1339.1 (1349.4) -> 1337.1 (1349.4) MB, 0.1 / 0.0 ms (+ 0.5 ms in 31 steps since last GC) [allocation failure].
   76512 ms: Scavenge 1339.1 (1349.4) -> 1337.1 (1349.4) MB, 0.2 / 0.1 ms (+ 0.5 ms in 32 steps since last GC) [allocation failure].


<--- JS stacktrace --->

==== JS stack trace =========================================

Security context: 0x2b82e2d48f9 <a DedicatedWorkerGlobalScope with map 0x34aea4d0ca79>
    2: expandFileStorage [0x2b82e204311 <undefined>:~1] [pc=0x389c1778f1c2](this=0x55512f7af41 <an Object with map 0x34aea4d145e1>,node=0x16792c4b5041 <JS Object>,newCapacity=104644370)
    3: write [0x2b82e204311 <undefined>:~1] [pc=0x389c1778caac](this=0x55512f8d391 <an Object with map 0x1642061bfe9>,stream=0x16792c4b51a9 <JS Object>,buffer=0x55512f7b...
@Rillke
Copy link
Owner

Rillke commented Nov 17, 2016

You could try encoding chunks and glueing them together with an application that has access to a real hard drive, e.g. ffmpeg. If the native flac container doesn't work, use the OGG container format --ogg.

Note that Chrome usually tells you its heap size limit if you ask for it: window.performance.memory.jsHeapSizeLimit

@jtoy
Copy link

jtoy commented May 22, 2018

just ran into this as well, the smallest wav I can make the error happen on is ~120 mb / 30 minute length.
Is this fixable in the library?

@floydback
Copy link

floydback commented Aug 19, 2019

Same problem with (not really) large file ~180 mb / 17 minutes.

Chrome error: "Pause before out of memory crash" on

FlacEncoder.flushErr = flushErr = function() {

If I resume it in DevTool it work's fine without crashes.

My DevTool shows:

window.performance.memory.jsHeapSizeLimit
2197815296

It's about 2GB

I use another workers for mp3/wav/ogg encoding with same big files and there is no problem with memory limit.

@Rillke
Copy link
Owner

Rillke commented Aug 20, 2019

Chrome error: "Pause before out of memory crash" on

If you already have the debugger there, a full stack trace would be nice :)

@floydback
Copy link

floydback commented Jan 21, 2020

Seems Pause before out of memory error came from EmsWorkerProxy.js on the second line of

function _emscripten_memcpy_big(dest, src, num) {
    HEAPU8.set(HEAPU8.subarray(src, src + num), dest); // <-- here error Pause before out of memory
    return dest
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants