Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #32524 > unrolled thread

removeEventListener why

Started byAndrew Poulos <ap_prog@hotmail.com>
First post2017-02-07 11:46 +1100
Last post2017-02-08 05:54 -0800
Articles 2 on this page of 22 — 7 participants

Back to article view | Back to comp.lang.javascript


Contents

  removeEventListener why Andrew Poulos <ap_prog@hotmail.com> - 2017-02-07 11:46 +1100
    Re: removeEventListener why "Julio P. Di Egidio" <julio@diegidio.name> - 2017-02-07 05:51 +0100
      Re: removeEventListener why "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-07 11:41 +0100
        Re: removeEventListener why Julio Di Egidio <julio@diegidio.name> - 2017-02-07 03:00 -0800
          Re: removeEventListener why "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-07 12:44 +0100
        Re: removeEventListener why JJ <jj4public@vfemail.net> - 2017-02-07 22:50 +0700
          Re: removeEventListener why "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-07 18:17 +0100
            Re: removeEventListener why JJ <jj4public@vfemail.net> - 2017-02-08 23:11 +0700
              Re: removeEventListener why "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-08 19:39 +0100
          Re: removeEventListener why Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-02-09 02:02 +0100
            Re: removeEventListener why Julio Di Egidio <julio@diegidio.name> - 2017-02-08 20:33 -0800
              Re: removeEventListener why "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-09 11:51 +0100
              Re: removeEventListener why Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-02-09 12:01 +0100
            Re: removeEventListener why JJ <jj4public@vfemail.net> - 2017-02-09 18:36 +0700
              Re: removeEventListener why Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-02-09 13:09 +0100
    Re: removeEventListener why "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-02-07 06:32 -0800
      Re: removeEventListener why Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-02-07 17:31 +0100
        Re: removeEventListener why Julio Di Egidio <julio@diegidio.name> - 2017-02-07 11:59 -0800
          Re: removeEventListener why Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-02-07 21:55 +0100
            Re: removeEventListener why Julio Di Egidio <julio@diegidio.name> - 2017-02-07 13:23 -0800
              Re: removeEventListener why "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-02-08 06:03 -0800
        Re: removeEventListener why "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2017-02-08 05:54 -0800

Page 2 of 2 — ← Prev page 1 [2]


#32564

From"Michael Haufe (TNO)" <tno@thenewobjective.com>
Date2017-02-08 06:03 -0800
Message-ID<5e47d762-6ef6-4359-a1ed-5d6450ff3881@googlegroups.com>
In reply to#32558
Julio Di Egidio wrote:
> Thomas 'PointedEars' Lahn wrote:
> > Julio Di Egidio wrote:
> > > […] Thomas 'PointedEars' […] Lahn wrote:
> > >> Michael Haufe (TNO) wrote:
> > >> > Andrew Poulos wrote:
> > >> >> Is it good practice to remove all listeners I add or does it make no
> > >> >> difference? I'm usually careful about removing all listeners I add but
> > >> >> I don't know if today it serves any real purpose.
> > >> >> 
> > >> >> In the past I used to be worried about memory leaks. Is it still an
> > >> >> issue?
> > >> > Doesn't matter anymore on modern browsers.
> > >> True;
> > > 
> > > It is not true, even on the latest browsers...
> > 
> > Interesting.  Cite evidence.
> 
> If your daily browsing experience isn't enough to convince you, this needs a little test bench, which I might put together as soon as I manage, this may indeed be of general interest.  Of course, feel free to beat me to it.

Don't forget that modern browser behavior is to support fast navigation through caching page state; old web pages will stick around in memory for a period of time. This was 10 minutes per tab last I looked (~3 years ago) in FireFox

[toc] | [prev] | [next] | [standalone]


#32563

From"Michael Haufe (TNO)" <tno@thenewobjective.com>
Date2017-02-08 05:54 -0800
Message-ID<8222ec8c-2d5a-48f4-8b13-0694795fb93c@googlegroups.com>
In reply to#32552
On Tuesday, February 7, 2017 at 10:31:07 AM UTC-6, Thomas 'PointedEars' Lahn wrote:
> Michael Haufe (TNO) wrote:
> 
> > On Monday, February 6, 2017 at 6:46:14 PM UTC-6, Andrew Poulos wrote:
> >> Is it good practice to remove all listeners I add or does it make no
> >> difference? I'm usually careful about removing all listeners I add but I
> >> don't know if today it serves any real purpose.
> >> 
> >> In the past I used to be worried about memory leaks. Is it still an
> >> issue?
> > 
> > Doesn't matter anymore on modern browsers.
> 
> True; however, it is a good rule of thumb.  Backwards-compatibility can be 
> important; I would think that it is in Andrew’s case (IIRC, he is developing 
> e-learning applications based on Moodle).
> 
> In which browser/layout engine versions is this issue resolved?

Post IE7 for DOM <-> JS cyclical references. IIRC, the competitor browsers didn't have the issue:

<https://msdn.microsoft.com/en-us/library/dd361842(v=vs.85).aspx>

We'd have to do some CLJS archaeology for more specifics I think, I've slept since then...

Other leaks do come up though unrelated to closures and events though from time to time:

<https://support.microsoft.com/en-us/help/975736/a-memory-leak-occurs-when-you-open-a-web-page-that-contains-a-circular-reference-in-an-iframe>

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.lang.javascript


csiph-web