Hi,
I'm developing a game in the browser mainly for Apple hardware (I don't have much choice in the matter) and I'm encountering a problem that completely destroys the game experience.
After countless tests, I'm pretty sure that there is a memory leak when I play music on Apple hardware. Indeed, after playing a certain number of tunes, the game starts to gradually lose fps until it restarts the page due to a memory shortage problem.
These problems have been seen on Gen 6 iPads and on my old Macbook Pro 2011. On Safari, and also on Chrome.
For some reason I can't figure out, this problem does not appear on an iPad Pro.
While testing with a low-end android (wiko), a recent samsung galaxy, a Windows computer, no problem either.
Possible ways to solve the problem
I obviously tried a number of things:
- unload the music once it's finished: it's useless
- stop the music once it's finished: it's useless (Apple devices don't manage several audio tracks simultaneously and stop the previous track as soon as a new one is launched)
- I'm starting to wonder if I don't want to turn the music into sounds to test it. Any optinion?
Has anyone encountered a similar problem?
To illustrate this problem, I made an example that plays music every second (at -50db not to ruin your ears). The problem explained is fairly well reproduced in this example, but takes a few minutes to crash the page.
A link to the .c3p
Thanks for your insights!