circular memory leaks: cleanup in all browsers beneficial

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peter Michaux

    circular memory leaks: cleanup in all browsers beneficial

    I just ran some circular memory leak tests in IE6, O9, S3, FF2 and it
    seems to me they all benefit from doing the same kind of circular
    memory leak cleanup that IE requires.

    My tests were very similar to Richard Cornford's which are very easy
    to set up and watch run.

    <URL: http://groups.google.c om/group/comp.lang.javas cript/msg/e723d3324aaa412 7>

    On my machine, O, S, and FF all level off at around 38MB of RAM while
    the pages load and unload. If I am using the cleanup. If I don't use
    cleanup they seem to level off at about 180MB.

    I've always been using the onunload cleanup for all browsers and was
    considering stopping doing that for all but Internet Explorerer. I
    won't be stopping on any browser. It seems all the garbage collectors
    can use the help.

    Peter
  • Peter Michaux

    #2
    Re: circular memory leaks: cleanup in all browsers beneficial

    On Feb 18, 10:33 am, Peter Michaux <petermich...@g mail.comwrote:
    I just ran some circular memory leak tests in IE6, O9, S3, FF2 and it
    seems to me they all benefit from doing the same kind of circular
    memory leak cleanup that IE requires.
    >
    My tests were very similar to Richard Cornford's which are very easy
    to set up and watch run.
    >
    <URL:http://groups.google.c om/group/comp.lang.javas cript/msg/e723d3324aaa412 7>
    >
    On my machine, O, S, and FF all level off at around 38MB of RAM while
    the pages load and unload. If I am using the cleanup. If I don't use
    cleanup they seem to level off at about 180MB.
    >
    I've always been using the onunload cleanup for all browsers and was
    considering stopping doing that for all but Internet Explorerer. I
    won't be stopping on any browser. It seems all the garbage collectors
    can use the help.
    Oddly enough it seems that just the following in the non-IE browsers
    is enough to trigger garbage collection onunload

    global.addEvent Listener(
    'unload',
    function() {},
    false);

    Peter

    Comment

    • Ed

      #3
      Re: circular memory leaks: cleanup in all browsers beneficial

      On Feb 18, 12:58 pm, Peter Michaux <petermich...@g mail.comwrote:
      On Feb 18, 10:33 am, Peter Michaux <petermich...@g mail.comwrote:
      >
      >
      >
      >
      >
      >
      >
      I just ran some circular memory leak tests in IE6, O9, S3, FF2 and it
      seems to me they all benefit from doing the same kind of circular
      memory leak cleanup that IE requires.
      >
      My tests were very similar to Richard Cornford's which are very easy
      to set up and watch run.
      >
      <URL:http://groups.google.c om/group/comp.lang.javas cript/msg/e723d3324aaa412 7>
      >
      On my machine, O, S, and FF all level off at around 38MB of RAM while
      the pages load and unload. If I am using the cleanup. If I don't use
      cleanup they seem to level off at about 180MB.
      >
      I've always been using the onunload cleanup for all browsers and was
      considering stopping doing that for all but Internet Explorerer. I
      won't be stopping on any browser. It seems all the garbage collectors
      can use the help.
      >
      Oddly enough it seems that just the following in the non-IE browsers
      is enough to trigger garbage collection onunload
      >
      global.addEvent Listener(
      'unload',
      function() {},
      false);
      >
      Peter
      I think this is explained here:

      The unload event is fired when the document or a child resource is being unloaded.


      It says, "using this event handler in your page prevents Firefox 1.5
      from caching the page in the in-memory bfcache".

      Comment

      • Peter Michaux

        #4
        Re: circular memory leaks: cleanup in all browsers beneficial

        On Feb 18, 11:42 am, Ed <e...@siliconfo rks.comwrote:
        On Feb 18, 12:58 pm, Peter Michaux <petermich...@g mail.comwrote:
        Oddly enough it seems that just the following in the non-IE browsers
        is enough to trigger garbage collection onunload
        >
        global.addEvent Listener(
        'unload',
        function() {},
        false);
        >
        Peter
        >
        I think this is explained here:
        >
        The unload event is fired when the document or a child resource is being unloaded.

        >
        It says, "using this event handler in your page prevents Firefox 1.5
        from caching the page in the in-memory bfcache".
        Ed, thank you. That seems like a reasonable explanation.

        Peter

        Comment

        • David Mark

          #5
          Re: circular memory leaks: cleanup in all browsers beneficial

          On Feb 18, 3:33 pm, Peter Michaux <petermich...@g mail.comwrote:
          On Feb 18, 11:42 am, Ed <e...@siliconfo rks.comwrote:
          >
          >
          >
          >
          >
          On Feb 18, 12:58 pm, Peter Michaux <petermich...@g mail.comwrote:
          Oddly enough it seems that just the following in the non-IE browsers
          is enough to trigger garbage collection onunload
          >
                global.addEvent Listener(
                  'unload',
                  function() {},
                  false);
          >
          Peter
          >
          I think this is explained here:
          >>
          It says, "using this event handler in your page prevents Firefox 1.5
          from caching the page in the in-memory bfcache".
          >
          Which also prevents fast history navigation.
          Ed, thank you. That seems like a reasonable explanation.
          >
          So perhaps those were false positives in the other browsers?

          Comment

          • Peter Michaux

            #6
            Re: circular memory leaks: cleanup in all browsers beneficial

            On Feb 18, 2:32 pm, David Mark <dmark.cins...@ gmail.comwrote:
            On Feb 18, 3:33 pm, Peter Michaux <petermich...@g mail.comwrote:
            >
            >
            >
            On Feb 18, 11:42 am, Ed <e...@siliconfo rks.comwrote:
            >
            On Feb 18, 12:58 pm, Peter Michaux <petermich...@g mail.comwrote:
            Oddly enough it seems that just the following in the non-IE browsers
            is enough to trigger garbage collection onunload
            >
            global.addEvent Listener(
            'unload',
            function() {},
            false);
            >
            Peter
            >
            I think this is explained here:
            >>
            It says, "using this event handler in your page prevents Firefox 1.5
            from caching the page in the in-memory bfcache".
            >
            Which also prevents fast history navigation.
            >
            Ed, thank you. That seems like a reasonable explanation.
            >
            So perhaps those were false positives in the other browsers?
            They do seem to level off at about 180MB of RAM use so I can imagine
            the cache is full at that point and just killing the oldest stuff. If
            it was a leak it would just keep building, I would think.

            Peter

            Comment

            • dhtml

              #7
              Re: circular memory leaks: cleanup in all browsers beneficial

              On Feb 18, 2:32 pm, David Mark <dmark.cins...@ gmail.comwrote:
              On Feb 18, 3:33 pm, Peter Michaux <petermich...@g mail.comwrote:
              >
              >
              >
              On Feb 18, 11:42 am, Ed <e...@siliconfo rks.comwrote:
              >
              On Feb 18, 12:58 pm, Peter Michaux <petermich...@g mail.comwrote:
              Oddly enough it seems that just the following in the non-IE browsers
              is enough to trigger garbage collection onunload
              >
              global.addEvent Listener(
              'unload',
              function() {},
              false);
              >
              Peter
              >
              I think this is explained here:
              >>
              It says, "using this event handler in your page prevents Firefox 1.5
              from caching the page in the in-memory bfcache".
              >
              Which also prevents fast history navigation.
              >
              Ed, thank you. That seems like a reasonable explanation.
              >
              Not only that, it's a good reason to want to not have an onunload
              handler in a lot of cases.
              So perhaps those were false positives in the other browsers?
              It would be nice there were a good way to detect memory leaks, so you
              could conditionally add an onlunload handler.

              Comment

              Working...