{"action":"created","issue":{"url":"https://api.github.com/repos/kripken/emscripten/issues/3838","labels_url":"https://api.github.com/repos/kripken/emscripten/issues/3838/labels{/name}","comments_url":"https://api.github.com/repos/kripken/emscripten/issues/3838/comments","events_url":"https://api.github.com/repos/kripken/emscripten/issues/3838/events","html_url":"https://github.com/kripken/emscripten/issues/3838","id":110521187,"number":3838,"title":"TypeError: asm.js type error: allocation failure during compilation","user":{"login":"gouletr","id":6430434,"avatar_url":"https://avatars.githubusercontent.com/u/6430434?v=3","gravatar_id":"","url":"https://api.github.com/users/gouletr","html_url":"https://github.com/gouletr","followers_url":"https://api.github.com/users/gouletr/followers","following_url":"https://api.github.com/users/gouletr/following{/other_user}","gists_url":"https://api.github.com/users/gouletr/gists{/gist_id}","starred_url":"https://api.github.com/users/gouletr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gouletr/subscriptions","organizations_url":"https://api.github.com/users/gouletr/orgs","repos_url":"https://api.github.com/users/gouletr/repos","events_url":"https://api.github.com/users/gouletr/events{/privacy}","received_events_url":"https://api.github.com/users/gouletr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2015-10-08T19:07:50Z","updated_at":"2015-10-09T20:32:18Z","closed_at":null,"body":"I just recently updated to latest incoming branch, and now I get this new error when opening my Emscripten generated game into Firefox Nightly :\r\n\r\n```\r\nTypeError: asm.js type error: allocation failure during compilation\r\nTypeError: asm.js type error: internal compiler failure (probably out of memory)\r\n```\r\n...and then FireFox Nightly says This tab has crashed.\r\n\r\nOur engine source code didn't change in between, so it is definitively a new problem in Emscripten. We were on `1.34.8`, so this happened not long ago.\r\n\r\nStrangely, I discovered that after a few attempts, it starts working!? And it loads way faster than it did before... now I am getting these messages at start time:\r\n```\r\nSuccessfully compiled asm.js code (loaded from cache in 303ms)\r\nPreallocating 6 workers for a pthread spawn pool.\r\n: Successfully compiled asm.js code (loaded from cache in 474ms)\r\n: Successfully compiled asm.js code (loaded from cache in 743ms)\r\n: Successfully compiled asm.js code (loaded from cache in 1023ms)\r\n: Successfully compiled asm.js code (loaded from cache in 1303ms)\r\n: Successfully compiled asm.js code (loaded from cache in 1594ms)\r\n: Successfully compiled asm.js code (loaded from cache in 1887ms)\r\n```\r\n\r\nWhile I like this new caching behavior, it seems it makes the compiler going crazy with memory allocations the first time it runs. I can clearly see it in the task manager memory curve; it allocates about ~14GB of RAM to compile, were it used to take around ~2GB before."},"comment":{"url":"https://api.github.com/repos/kripken/emscripten/issues/comments/146979699","html_url":"https://github.com/kripken/emscripten/issues/3838#issuecomment-146979699","issue_url":"https://api.github.com/repos/kripken/emscripten/issues/3838","id":146979699,"user":{"login":"kripken","id":173661,"avatar_url":"https://avatars.githubusercontent.com/u/173661?v=3","gravatar_id":"","url":"https://api.github.com/users/kripken","html_url":"https://github.com/kripken","followers_url":"https://api.github.com/users/kripken/followers","following_url":"https://api.github.com/users/kripken/following{/other_user}","gists_url":"https://api.github.com/users/kripken/gists{/gist_id}","starred_url":"https://api.github.com/users/kripken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kripken/subscriptions","organizations_url":"https://api.github.com/users/kripken/orgs","repos_url":"https://api.github.com/users/kripken/repos","events_url":"https://api.github.com/users/kripken/events{/privacy}","received_events_url":"https://api.github.com/users/kripken/received_events","type":"User","site_admin":false},"created_at":"2015-10-09T20:32:18Z","updated_at":"2015-10-09T20:32:18Z","body":"Btw, I assume that when you build without pthreads, the problem does not occur? (of course the app won't run, but just the memory issue with the script by itself)"}}