First I'm sorry to post this in the general discussion, but I've already posted three times a similar topic in the bugs section that was moved in the closed bugs. The problem is related to creating objects with physic behavior on the fly. As seen in this topic https://www.scirra.com/forum/physics-error-and-crash_t150137, other people encounter the same bug, and it seems to be not linked to how many objects you create even though the bug occurs more often with many objects created.
After testing, and reading others comments and experiences, I'm pretty sure it's not the "way" asm.js is programmed, but a memory leak.
So I posted here because Ashley closed the topic each time with no more explanation and we can't discuss any more about and maybe find a solution.
If someone is interested, we can go further together. It's a big issue for me as I'm working on a commercial project and at the moment I'm stuck on this (it crashes the program).
Thank you all for your time.
I personally think scirra would be better off focusing on fully implementing one proven and versatile physics engine as a full-up plugin (ie full box2d?) as I think that would be a better selling point than indefinitely waiting to see if emscripten will one day become reliable.
I downloaded your capx file from the thread above and it crashed for me after a couple hundred coins were created...
then I removed the regular physics behaviors and changed them to Chipmunk physics. I am up to over 2500 coins, and it has been running for around half an hour with no trouble. (I also added a text box that displays how many coins there are).
I first tried Chipmunk physics last week when I needed to know how much force was being applied to an object and the regular physics did not seem to have a way to do that. But I was amazed at how much faster my game ran on my iphone with Chipmunk physics. With the asm.js physics it would stutter and was barely playable, but with Chipmunk physics it ran smoothly (as well as giving me the extra info I needed). So, I would give that a try!
Develop games in your browser. Powerful, performant & highly capable.
In my game, when i select asm.js as a physics engine, the game crashes randomly after random amount of time, i don't know if it's a same issue as discussed here, and i can't reproduce it because it's so random. I can only say that i don't have crashes with box2dweb.