Code Monkey home page Code Monkey logo

Comments (14)

brihogan avatar brihogan commented on July 19, 2024

Looks like scripts cannot be removed, at least not from chrome. That kind of sucks. Perhaps that's why memory increases? Still, the fact that "nodes" increase could be something to look into? Seems like as web apps become more massive it will become a necessity to unload scripts from memory.

from aura.

lucasjans avatar lucasjans commented on July 19, 2024

Did you try running the Chrome Profiler? See this screenshot: http://cl.ly/2d1G2z06142g1m1I2Z2d

This should give you the most accurate account of what's in memory. I'm curious what you'll find. I haven't tested this, but I hope the script are released from memory.

Edit: I just tested this by stopping/starting widgets in the Aura demo and the memory heap does seem to only grow:
http://cl.ly/1i1h0t3f2c25170z2w0q

from aura.

brihogan avatar brihogan commented on July 19, 2024

Yes, I ran the profiler and found the same thing you did - that memory grows. :( I'm guessing that this an issue with Chrome and not RequireJS or Aura - but, I'm not totally sure.

from aura.

addyosmani avatar addyosmani commented on July 19, 2024

@brihogan that's really weird. When we tested it we found that the memory decreased but this could be varying depending on a) version of chrome being used and b) whether there is something weird going on behind the scenes with RequireJS. We'll investigate. Thanks for reporting!

from aura.

brihogan avatar brihogan commented on July 19, 2024

Btw, I have version 19.0.1084.54. I will update and try again later.

from aura.

addyosmani avatar addyosmani commented on July 19, 2024

There are some interesting gotchas with the way the require.undef method works. In Aura's case I think one issue that came up was that whilst we're trying to handle widget unloading, we aren't manually unbinding event listeners and could be doing a better job of cleaning up DOM elements. We're going to look into this further to see what other improvements can be made.

from aura.

robertd avatar robertd commented on July 19, 2024

I'm experiencing the same memory issue on Chrome v20.0.1132.57. But what's more interesting. If I try to reload each widget 5+ times there are dragons :). For example... if I add the event to the calendar, same event is being added to the todo widget 4 or more times in a row.

from aura.

addyosmani avatar addyosmani commented on July 19, 2024

I'm considering the most elegant (non-verbose) way of solving this problem. If we were to extend our existing module unloading solution to also unbind all event handlers attached to a widget and it's children, would that be enough? Right now we're definitely not handling disposal of event handlers at all, so I'd like to nail down a solution to this.

from aura.

addyosmani avatar addyosmani commented on July 19, 2024

Note: There's definitely more we can do to (e.g static analysis to establish if there are other modules still using a dependency), but with the latest changes to the code I'm seeing memory drop when a widget is unloaded and increase when its reloaded (but not beyond the quantity of memory it was originally requiring).

Also, stopping and starting multiple times in a row is at the moment not resulting in any leaks/usage beyond what I would expect.

from aura.

dustinboston avatar dustinboston commented on July 19, 2024

@addyosmani it's good that we're at least breaking even. Before it just kept going up.

from aura.

tony avatar tony commented on July 19, 2024

I wonder if this is about Aura or more about backbone-aura the extension now.

Marionette EventBinder works with Backbone.Events and is mixed in with Backbone.Views to handle its garbage collection. #35's conversation handles this a bit.

Aura's backbone extension may have to cover views subscribing to stop to totally clear events before they're nix'd.
Ultimately, the backbone extensions can't become deeper involved in garbage collection of DOM/events without the augmenting the vendor libs (backbones) default cleanup behavior. I'm going to flesh this out a bit more.

Maybe that commit mentioned by @ndersh in #35 will be a help :)

from aura.

addyosmani avatar addyosmani commented on July 19, 2024

@tony I think now that we've decoupled from Backbone Aura this is probably more about that extension. For it specifically I honestly wouldn't mind us using EventBinder (which Derick has released as a separate project since). Maybe if we have time we'll look at this post the V1 pre?

from aura.

addyosmani avatar addyosmani commented on July 19, 2024

Aura is currently being fully rewritten and this issue is going to be resolved as a part of the work we've recently landed in master.

from aura.

sbellity avatar sbellity commented on July 19, 2024

@oliger and I are currently working on it... We should have something in
master this week.

On 17 févr. 2013, at 17:22, Addy Osmani [email protected] wrote:

Aura is currently being fully rewritten and this issue is going to be
resolved as a part of the work we've recently landed in master.


Reply to this email directly or view it on
GitHubhttps://github.com//issues/34#issuecomment-13688324.

from aura.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.