phetsims / vibe

Library for handling audio for PhET simulations. Provides cross-platform support and enables usage of base64 audio embedded in an HTML document.
MIT License
3 stars 3 forks source link

potential memory leak #22

Closed jbphet closed 8 years ago

jbphet commented 8 years ago

While investigating #20, I found that after extensive fuzz testing the demo/test app (i.e. vibe_en.html) would crash in Chrome with the "Aw, Snap!" error. This could indicate a memory leak. I ran fuzz testing with fuzzMouse=100 and took heap snapshots, sorted the data by the "object" column and the "Retained Size" column, and it does appear that something is leaking. Screenshots below.

At time ~0: vibe-mem-leak-1 vibe-mem-leak-2

At time ~3 min: vibe-mem-leak-3 vibe-mem-leak-4

At time ~6 min: vibe-mem-leak-5 vibe-mem-leak-6

jbphet commented 8 years ago

Memory leaks have been found that may explain what I was seeing here, and that don't relate to vibe, see https://github.com/phetsims/tasks/issues/546, https://github.com/phetsims/joist/issues/327, and https://github.com/phetsims/joist/issues/329.

jbphet commented 8 years ago

I tested the master version, which includes a fix for worst memory leak linked in the comment above, and there was far less leaked memory. The leakage that is seen now is similar to and probably explainable by the issue noted in https://github.com/phetsims/joist/issues/329. Here is a screenshot where snapshots were taken at roughly t=0 min, 3 min, and 6 min, as was done above. vibe-memory From this image, it can be seen that the rate of leakage nothing like it was during the original testing. Closing, since this is most likely not a problem with vibe.