red42 / HTML5_Genetic_Cars

A genetic algorithm car evolver in HTML5 canvas.
zlib License
1.19k stars 294 forks source link

Memory leak #37

Open eliduvid opened 4 years ago

eliduvid commented 4 years ago

Hey!

The app leaks memory, and fails because of it if you leave it running for long enough.

As I saw in heap dump, a problem is with allResults property of state, that is never cleaned up from old data, and seams to contain all the cars that ever existed of something like this. https://github.com/red42/HTML5_Genetic_Cars/blob/f3e9ce5233025f832fd09dafbae901e4485605ac/src/draw/plot-graphs.js#L49

Peace :-)