Closed GianlucaGuarini closed 9 years ago
Can you demonstrate the problem with Bacon.js core only?
The 2-way bindings in Bacon.Model may very well be prone to memory leaks. At least it's known that there's no way to "unbind".
I have written my own Bacon model but I got the same issue. In my case the Bacon.Bus class is leaking. The newest version 0.7.28 does not really solve the problem. It seems that there is too much memory allocated in the closures created using the onValue method. I will create a simpler example to demonstrate the issue
Despite the new releases and the new memory performance tests, according to my new test the heap memory usage is still pretty high, any idea? http://jsfiddle.net/gianlucaguarini/ekm716c9/ 63.1 MB for 5000 Bacon.Bus * 4 subscribers
I think probably the issue could be in the javascript file compiled, coffeescript creates too many closures
I will write a similar example using RxJS to see if it has the same problem
Could you provide a JSFiddle or something similar to demonstrate the issue? Would make it easier to find out if there's a leak or not.
It's right on my previous post :smile: I will post it again http://jsfiddle.net/gianlucaguarini/ekm716c9/
I wrote the same code using RxJS and it uses just 14.3 MB. RxJS uses a lot less memory (-77%) to achieve the same result!
That's pretty much expected, based on earlier memory footprint tests. There's still a lot of fat in Bacon. So if you need to minimize memory footprint, you should consider RxJs or Kefir at the moment.
Any updates on this?
@puppetmaster3 I recently tried stroxy by my friend @nilssolanki using native ES2015 Proxies. The results are much better and the memory footprint is ~95% smaller maybe bacon.js could consider switching to proxies as well
I think the following bug is not really just a Bacon.Model issue but it is more related to the Baconjs core https://github.com/baconjs/bacon.model/issues/10 Any possible solution?!