Netscape 7.1 memory leaks

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

    Netscape 7.1 memory leaks

    It seems that garbage collection is somewhat flawed in Netscape as the
    following little script can bring a machine to its knees in about an
    hour when run on Netstcape 7.1. I've tried freeing the variables
    manually, but Im not sure whats broken. I assume that the images
    aren't being freed when they are replaced. Is there a
    workaround/solution to this? I've read some old postings about this in
    4.x browsers, but I never saw a solution, and its apparently still not
    been repaired.

    Dennis

    <html>
    <head>
    <script language="JavaS cript">
    var myimage;

    function randgen()
    {
    var date = new Date();

    return date.getTime();
    }
    function loadIT()
    {
    myimage=new Image;

    myimage.src="so meimage.jpg?ran d=" + randgen();
    setTimeout("loa dIT()",1000);
    }
    loadIT();
    </script>
    </head>
    <body>
    </body>
    </html>
  • kaeli

    #2
    Re: Netscape 7.1 memory leaks

    In article <3bcf70cd.04042 60618.b70b590@p osting.google.c om>,
    dennis@etinc.co m enlightened us with...
    [color=blue]
    > <script language="JavaS cript">
    > var myimage;
    >
    > function randgen()
    > {
    > var date = new Date();[/color]

    You keep making a new date. Why not reuse the same one?
    Little scripts, this isn't an issue, but if it runs a lot, eventually
    you'll run out of memory.
    [color=blue]
    >
    > return date.getTime();
    > }
    > function loadIT()
    > {
    > myimage=new Image;[/color]

    Same as above.

    /old C programmer

    --
    --
    ~kaeli~
    What if the Hokey Pokey IS what's it's all about?



    Comment

    • Mike

      #3
      Re: Netscape 7.1 memory leaks

      > setTimeout("loa dIT()",1000);

      I beleive this is your problem. You have the loadIT() method call in
      quotation marks so basically it is just a meaningless string. To actually
      call the method the JavaScript engine will wrap the string in an annonymous
      function everytime this line of code is called.

      This new annonymous function is added to the window object. Hence the memory
      consuption problem, because the life of the annonymous function is equal to
      the life of the window object.

      The Date object creation is not a problem becuase it's life span is much
      shorter, basically just the life of the method call that creates it.

      To fix this problem simply rewrite that line of code to be

      setTimeout(load IT,1000);

      Now instead of a meanlingless string, you are passing a function handle
      which the method simple executes without adding any new objects into memory.

      Hope this helps
      Mike


      Comment

      • Richard Cornford

        #4
        Re: Netscape 7.1 memory leaks

        Mike wrote:[color=blue][color=green]
        >> setTimeout("loa dIT()",1000);[/color]
        >
        > I beleive this is your problem. You have the loadIT() method call in
        > quotation marks so basically it is just a meaningless string. To
        > actually call the method the JavaScript engine will wrap the string
        > in an annonymous function everytime this line of code is called.[/color]

        setTimeout has supported strings as its first argument longer than it
        has supported function references as its first argument (and so in more
        browsers). It is unlikely that setTimeout would create a function object
        in order to execute the string, it would only be necessary to pass it on
        to the - eval - function in order to have it executed.
        [color=blue]
        > This new annonymous function is added to the window object.[/color]

        Even if an anonymous function object was created for the execution of a
        string argument to setTimeout there is no reason to expect it to be
        added to the window object (and if it was added what property name would
        be used?).
        [color=blue]
        > Hence the
        > memory consuption problem, because the life of the annonymous
        > function is equal to the life of the window object.[/color]

        The continuous creation of Image objects is more likely the source of
        the memory leak (assuming that there is one, as no demonstration of the
        phenomenon has been provided).
        [color=blue]
        > The Date object creation is not a problem becuase it's life span is
        > much shorter, basically just the life of the method call that creates
        > it.
        >
        > To fix this problem simply rewrite that line of code to be
        >
        > setTimeout(load IT,1000);
        >
        > Now instead of a meanlingless string, ...[/color]
        <snip>

        That string was never meaningless, it is valid javascript source code,
        as should be provided when a string argument is used with setTimout.

        Richard.


        Comment

        • Brian Genisio

          #5
          Re: Netscape 7.1 memory leaks

          Richard Cornford wrote:[color=blue]
          > Mike wrote:
          >[color=green][color=darkred]
          >>>setTimeout(" loadIT()",1000) ;[/color]
          >>
          >>I beleive this is your problem. You have the loadIT() method call in
          >>quotation marks so basically it is just a meaningless string. To
          >>actually call the method the JavaScript engine will wrap the string
          >>in an annonymous function everytime this line of code is called.[/color]
          >
          >
          > setTimeout has supported strings as its first argument longer than it
          > has supported function references as its first argument (and so in more
          > browsers). It is unlikely that setTimeout would create a function object
          > in order to execute the string, it would only be necessary to pass it on
          > to the - eval - function in order to have it executed.
          >
          >[color=green]
          >>This new annonymous function is added to the window object.[/color]
          >
          >
          > Even if an anonymous function object was created for the execution of a
          > string argument to setTimeout there is no reason to expect it to be
          > added to the window object (and if it was added what property name would
          > be used?).
          >[/color]

          This is correct. Spidermonkey (the JS engine in Netscape/Mozilla) will
          create function objects as it would an integer or date. All objects are
          JSObject types, regardless of being a function, a string, a date, or a
          custom type. All objects are subject to garbage collection.
          [color=blue]
          >[color=green]
          >>Hence the
          >>memory consuption problem, because the life of the annonymous
          >>function is equal to the life of the window object.[/color]
          >
          >
          > The continuous creation of Image objects is more likely the source of
          > the memory leak (assuming that there is one, as no demonstration of the
          > phenomenon has been provided).
          >[/color]

          It seems like the image objects would be garbage collected as well, but
          there could be a cache thing going on. How big is the cache set to? (I
          am not sure if this matters or not). Since each Image object is
          associated with a cache entry (each image is randomly generated), it
          could be rooting the image objects in the Spidermonkey engine.

          OP: Does it exhibit this behavior when the cache is lower? How about
          when it is turned off?

          Can you point us to a link that causes this to happen? Does this happen
          in any other browsers? (IE, Safari, Opera, etc)

          Just some ideas,
          Brian

          Comment

          • Richard Cornford

            #6
            Re: Netscape 7.1 memory leaks

            Brian Genisio wrote:
            <snip>[color=blue]
            > ... . Spidermonkey (the JS engine in Netscape/Mozilla)
            > will create function objects as it would an integer or date.
            > All objects are JSObject types, regardless of being a function,
            > a string, a date, or a custom type. ...[/color]
            <snip>

            If code provided to setTimout as a string argument was executed in an
            anonymous function then an - arguments - object would be available to
            it. A quick test of:-

            setTimeout('ale rt(typeof arguments);',10 0);

            setTimeout(func tion(){alert(ty peof arguments);},10 0);

            Suggests that the code provided as a string argument is not executed in
            an anonymous function on Mozilla browsers.

            Richard.


            Comment

            • Brian Genisio

              #7
              Re: Netscape 7.1 memory leaks

              Richard Cornford wrote:[color=blue]
              > Brian Genisio wrote:
              > <snip>
              >[color=green]
              >>... . Spidermonkey (the JS engine in Netscape/Mozilla)
              >>will create function objects as it would an integer or date.
              >>All objects are JSObject types, regardless of being a function,
              >>a string, a date, or a custom type. ...[/color]
              >
              > <snip>
              >
              > If code provided to setTimout as a string argument was executed in an
              > anonymous function then an - arguments - object would be available to
              > it. A quick test of:-
              >
              > setTimeout('ale rt(typeof arguments);',10 0);
              >
              > setTimeout(func tion(){alert(ty peof arguments);},10 0);
              >
              > Suggests that the code provided as a string argument is not executed in
              > an anonymous function on Mozilla browsers.
              >
              > Richard.
              >
              >[/color]

              Yeah, sorry, I was not completely clear in what I was saying. I was
              saying "If a function object is being created..." in response to your
              "Even if an anonymous function object was created for the execution..."
              statement. I was making no assumptions about the way setTimeout (or
              other similar functions) executes the code, only working off the
              prefaced assumption that it does create an anonymous function object.

              In reality, I was agreeing completely with what you were saying, by
              backing it up with my understanding of the NS JS engine :)

              Have a day!
              Brian

              Comment

              • Dennis

                #8
                Re: Netscape 7.1 memory leaks

                "Richard Cornford" <Richard@litote s.demon.co.uk> wrote in message news:<c6jtbl$n2 h$1$8300dec7@ne ws.demon.co.uk> ...[color=blue]
                > Brian Genisio wrote:
                > <script language="JavaS cript">
                > var myimage;
                >
                > function randgen()
                > {
                > var date = new Date();[/color]
                [color=blue]
                >You keep making a new date. Why not reuse the same one?
                >Little scripts, this isn't an issue, but if it runs a lot, eventually
                >you'll run out of memory.[/color]

                Well if I dont get a "new date" is ceases to do with the function is
                intended to do. Its a local variable, so I would think that garbage
                collection would have no problem disposing of local variables.


                [color=blue]
                > <snip>[color=green]
                > > ... . Spidermonkey (the JS engine in Netscape/Mozilla)
                > > will create function objects as it would an integer or date.
                > > All objects are JSObject types, regardless of being a function,
                > > a string, a date, or a custom type. ...[/color]
                > <snip>
                >
                > If code provided to setTimout as a string argument was executed in an
                > anonymous function then an - arguments - object would be available to
                > it. A quick test of:-
                >
                > setTimeout('ale rt(typeof arguments);',10 0);
                >
                > setTimeout(func tion(){alert(ty peof arguments);},10 0);
                >[/color]

                Given all of this philosophical banter, I've tested it both ways and
                it makes no difference in terms of lost memory. In fact I think I've
                tested every variation of "normal" code possible, which is why I
                originally concluded that the problem had to do with the ".src" object
                not being freed when it is replaced. Assuming Im correct, any ideas on
                how to explicitly free the image object before replacing it? "new"
                should free the old one, I would think. I've also tried:

                myImage = new Image;

                function()
                {
                myImage.src=nul l;
                myImage.src="wh atever";
                }
                with the same memory loss. Its quite baffling. I dont know if I
                mentioned it, but ALL of these variations show NO memory loss in IE,
                no matter how badly I code it (just so someone says something nice
                about MS once in a while :-)

                Dennis

                Comment

                • Brian Genisio

                  #9
                  Re: Netscape 7.1 memory leaks

                  Dennis wrote:
                  [color=blue]
                  > "Richard Cornford" <Richard@litote s.demon.co.uk> wrote in message news:<c6jtbl$n2 h$1$8300dec7@ne ws.demon.co.uk> ...
                  >[color=green]
                  >>Brian Genisio wrote:
                  >><script language="JavaS cript">
                  >> var myimage;
                  >>
                  >> function randgen()
                  >> {
                  >> var date = new Date();[/color]
                  >
                  >[color=green]
                  >>You keep making a new date. Why not reuse the same one?
                  >>Little scripts, this isn't an issue, but if it runs a lot, eventually
                  >>you'll run out of memory.[/color]
                  >
                  >
                  > Well if I dont get a "new date" is ceases to do with the function is
                  > intended to do. Its a local variable, so I would think that garbage
                  > collection would have no problem disposing of local variables.
                  >
                  >
                  >
                  >[color=green]
                  >><snip>
                  >>[color=darkred]
                  >>>... . Spidermonkey (the JS engine in Netscape/Mozilla)
                  >>>will create function objects as it would an integer or date.
                  >>>All objects are JSObject types, regardless of being a function,
                  >>>a string, a date, or a custom type. ...[/color]
                  >>
                  >><snip>
                  >>
                  >>If code provided to setTimout as a string argument was executed in an
                  >>anonymous function then an - arguments - object would be available to
                  >>it. A quick test of:-
                  >>
                  >>setTimeout('a lert(typeof arguments);',10 0);
                  >>
                  >>setTimeout(fu nction(){alert( typeof arguments);},10 0);
                  >>[/color]
                  >
                  >
                  > Given all of this philosophical banter, I've tested it both ways and
                  > it makes no difference in terms of lost memory. In fact I think I've
                  > tested every variation of "normal" code possible, which is why I
                  > originally concluded that the problem had to do with the ".src" object
                  > not being freed when it is replaced. Assuming Im correct, any ideas on
                  > how to explicitly free the image object before replacing it? "new"
                  > should free the old one, I would think. I've also tried:
                  >
                  > myImage = new Image;
                  >
                  > function()
                  > {
                  > myImage.src=nul l;
                  > myImage.src="wh atever";
                  > }
                  > with the same memory loss. Its quite baffling. I dont know if I
                  > mentioned it, but ALL of these variations show NO memory loss in IE,
                  > no matter how badly I code it (just so someone says something nice
                  > about MS once in a while :-)
                  >
                  > Dennis[/color]

                  What about the cache thing that I mentioned?

                  I dont know if I would call what you are experiencing a memory leak. A
                  memory leak is where memory continues to grow, and the program looses
                  track of it. I am guessing that Netscape has not lost track of the
                  memory, but is just holding on to it instead.

                  You might try asking this question in:
                  netscape.public .mozilla.dom
                  netscape.public .mozilla.jseng

                  Your question might be slightly off topic in both of those groups, but
                  the people there might have the knowledge to help.

                  Brian


                  Comment

                  • Dennis

                    #10
                    Re: Netscape 7.1 memory leaks

                    Brian Genisio <BrianGenisio@y ahoo.com> wrote in message news:<408e70c7$ 1@10.10.0.241>. ..[color=blue]
                    > Dennis wrote:
                    >[color=green]
                    > > "Richard Cornford" <Richard@litote s.demon.co.uk> wrote in message news:<c6jtbl$n2 h$1$8300dec7@ne ws.demon.co.uk> ...
                    > >[color=darkred]
                    > >>Brian Genisio wrote:
                    > >><script language="JavaS cript">
                    > >> var myimage;
                    > >>
                    > >> function randgen()
                    > >> {
                    > >> var date = new Date();[/color]
                    > >
                    > >[color=darkred]
                    > >>You keep making a new date. Why not reuse the same one?
                    > >>Little scripts, this isn't an issue, but if it runs a lot, eventually
                    > >>you'll run out of memory.[/color]
                    > >
                    > >
                    > > Well if I dont get a "new date" is ceases to do with the function is
                    > > intended to do. Its a local variable, so I would think that garbage
                    > > collection would have no problem disposing of local variables.
                    > >
                    > >
                    > >
                    > >[color=darkred]
                    > >><snip>
                    > >>
                    > >>>... . Spidermonkey (the JS engine in Netscape/Mozilla)
                    > >>>will create function objects as it would an integer or date.
                    > >>>All objects are JSObject types, regardless of being a function,
                    > >>>a string, a date, or a custom type. ...
                    > >>
                    > >><snip>
                    > >>
                    > >>If code provided to setTimout as a string argument was executed in an
                    > >>anonymous function then an - arguments - object would be available to
                    > >>it. A quick test of:-
                    > >>
                    > >>setTimeout('a lert(typeof arguments);',10 0);
                    > >>
                    > >>setTimeout(fu nction(){alert( typeof arguments);},10 0);
                    > >>[/color]
                    > >
                    > >
                    > > Given all of this philosophical banter, I've tested it both ways and
                    > > it makes no difference in terms of lost memory. In fact I think I've
                    > > tested every variation of "normal" code possible, which is why I
                    > > originally concluded that the problem had to do with the ".src" object
                    > > not being freed when it is replaced. Assuming Im correct, any ideas on
                    > > how to explicitly free the image object before replacing it? "new"
                    > > should free the old one, I would think. I've also tried:
                    > >
                    > > myImage = new Image;
                    > >
                    > > function()
                    > > {
                    > > myImage.src=nul l;
                    > > myImage.src="wh atever";
                    > > }
                    > > with the same memory loss. Its quite baffling. I dont know if I
                    > > mentioned it, but ALL of these variations show NO memory loss in IE,
                    > > no matter how badly I code it (just so someone says something nice
                    > > about MS once in a while :-)
                    > >
                    > > Dennis[/color]
                    >
                    > What about the cache thing that I mentioned?
                    >
                    > I dont know if I would call what you are experiencing a memory leak. A
                    > memory leak is where memory continues to grow, and the program looses
                    > track of it. I am guessing that Netscape has not lost track of the
                    > memory, but is just holding on to it instead.
                    >
                    > You might try asking this question in:
                    > netscape.public .mozilla.dom
                    > netscape.public .mozilla.jseng
                    >
                    > Your question might be slightly off topic in both of those groups, but
                    > the people there might have the knowledge to help.
                    >
                    > Brian[/color]


                    Since it "holds onto it" until the browser is closed (and the OS has
                    to do it), I think it would qualify as a leak. There's too many bugs
                    in Mozilla to bother reporting such things, and you'll lose more
                    customers telling people to upgrade their buggy netscape browsers than
                    you will telling them to fire up IE in the long run anyway.

                    Comment

                    • Brian Genisio

                      #11
                      Re: Netscape 7.1 memory leaks

                      Dennis wrote:
                      [color=blue]
                      > Brian Genisio <BrianGenisio@y ahoo.com> wrote in message news:<408e70c7$ 1@10.10.0.241>. ..
                      >[color=green]
                      >>Dennis wrote:
                      >>
                      >>[color=darkred]
                      >>>"Richard Cornford" <Richard@litote s.demon.co.uk> wrote in message news:<c6jtbl$n2 h$1$8300dec7@ne ws.demon.co.uk> ...
                      >>>
                      >>>
                      >>>>Brian Genisio wrote:
                      >>>><script language="JavaS cript">
                      >>>> var myimage;
                      >>>>
                      >>>> function randgen()
                      >>>> {
                      >>>> var date = new Date();
                      >>>
                      >>>
                      >>>>You keep making a new date. Why not reuse the same one?
                      >>>>Little scripts, this isn't an issue, but if it runs a lot, eventually
                      >>>>you'll run out of memory.
                      >>>
                      >>>
                      >>>Well if I dont get a "new date" is ceases to do with the function is
                      >>>intended to do. Its a local variable, so I would think that garbage
                      >>>collection would have no problem disposing of local variables.
                      >>>
                      >>>
                      >>>
                      >>>
                      >>>
                      >>>><snip>
                      >>>>
                      >>>>>... . Spidermonkey (the JS engine in Netscape/Mozilla)
                      >>>>>will create function objects as it would an integer or date.
                      >>>>>All objects are JSObject types, regardless of being a function,
                      >>>>>a string, a date, or a custom type. ...
                      >>>>
                      >>>><snip>
                      >>>>
                      >>>>If code provided to setTimout as a string argument was executed in an
                      >>>>anonymous function then an - arguments - object would be available to
                      >>>>it. A quick test of:-
                      >>>>
                      >>>>setTimeout( 'alert(typeof arguments);',10 0);
                      >>>>
                      >>>>setTimeout( function(){aler t(typeof arguments);},10 0);
                      >>>>
                      >>>
                      >>>
                      >>>Given all of this philosophical banter, I've tested it both ways and
                      >>>it makes no difference in terms of lost memory. In fact I think I've
                      >>>tested every variation of "normal" code possible, which is why I
                      >>>originally concluded that the problem had to do with the ".src" object
                      >>>not being freed when it is replaced. Assuming Im correct, any ideas on
                      >>>how to explicitly free the image object before replacing it? "new"
                      >>>should free the old one, I would think. I've also tried:
                      >>>
                      >>>myImage = new Image;
                      >>>
                      >>>function()
                      >>>{
                      >>> myImage.src=nul l;
                      >>> myImage.src="wh atever";
                      >>>}
                      >>>with the same memory loss. Its quite baffling. I dont know if I
                      >>>mentioned it, but ALL of these variations show NO memory loss in IE,
                      >>>no matter how badly I code it (just so someone says something nice
                      >>>about MS once in a while :-)
                      >>>
                      >>>Dennis[/color]
                      >>
                      >>What about the cache thing that I mentioned?
                      >>
                      >>I dont know if I would call what you are experiencing a memory leak. A
                      >>memory leak is where memory continues to grow, and the program looses
                      >>track of it. I am guessing that Netscape has not lost track of the
                      >>memory, but is just holding on to it instead.
                      >>
                      >>You might try asking this question in:
                      >>netscape.publ ic.mozilla.dom
                      >>netscape.publ ic.mozilla.jsen g
                      >>
                      >>Your question might be slightly off topic in both of those groups, but
                      >>the people there might have the knowledge to help.
                      >>
                      >>Brian[/color]
                      >
                      >
                      >
                      > Since it "holds onto it" until the browser is closed (and the OS has
                      > to do it), I think it would qualify as a leak. There's too many bugs
                      > in Mozilla to bother reporting such things, and you'll lose more
                      > customers telling people to upgrade their buggy netscape browsers than
                      > you will telling them to fire up IE in the long run anyway.[/color]

                      Ok, I didnt realize that it held on to the images until the browser was
                      closed. Are you sure it is not re-using the memory? They may have a
                      memory manager that takes what it needs, and frees it logically, but not
                      to the OS. This way, it can use it for other pages. Either way, if it
                      continues to grow, there is obviously a problem. Too bad no one here
                      can help. I know I cant think of anything else.

                      Did you try the netscape groups I mentioned? These are public groups,
                      with some netscape developers. They my know of work-arounds.

                      Brian

                      Comment

                      • Grant Wagner

                        #12
                        Re: Netscape 7.1 memory leaks

                        Dennis wrote:
                        [color=blue]
                        > It seems that garbage collection is somewhat flawed in Netscape as the
                        > following little script can bring a machine to its knees in about an
                        > hour when run on Netstcape 7.1. I've tried freeing the variables
                        > manually, but Im not sure whats broken. I assume that the images
                        > aren't being freed when they are replaced. Is there a
                        > workaround/solution to this? I've read some old postings about this in
                        > 4.x browsers, but I never saw a solution, and its apparently still not
                        > been repaired.
                        >
                        > Dennis
                        >
                        > <html>
                        > <head>
                        > <script language="JavaS cript">
                        > var myimage;
                        >
                        > function randgen()
                        > {
                        > var date = new Date();
                        >
                        > return date.getTime();
                        > }
                        > function loadIT()
                        > {
                        > myimage=new Image;
                        >
                        > myimage.src="so meimage.jpg?ran d=" + randgen();
                        > setTimeout("loa dIT()",1000);
                        > }
                        > loadIT();
                        > </script>
                        > </head>
                        > <body>
                        > </body>
                        > </html>[/color]

                        Garbage collection is a low-priority task. You're creating new objects at
                        the rate of one a second over an hour. Netscape probably never bothers to
                        do any garbage collection until the browser is more "idle" then you are
                        allowing it to be at any point during the execution. As a result it just
                        continues to request memory from the operating system (which the operating
                        system is happy to provide up to and beyond the amount of physical memory
                        present on the system). Once you exceed the amount of physical memory
                        available, the operating system will begin to swap and you will have
                        serious performance problems.

                        Do you really want everyone using that page to be making requests to your
                        Web server every second? Since you never display the image I'm guessing
                        you're using it as some sort of "keep alive" session management or
                        something? HTTP through a Web browser isn't really the proper medium for
                        something that requires knowing if the client is connected every second.
                        You're trying to drive a nail with a screwdriver.

                        --
                        | Grant Wagner <gwagner@agrico reunited.com>

                        * Client-side Javascript and Netscape 4 DOM Reference available at:
                        *


                        * Internet Explorer DOM Reference available at:
                        *
                        Learn with interactive lessons and technical documentation, earn professional development hours and certifications, and connect with the community.


                        * Netscape 6/7 DOM Reference available at:
                        * http://www.mozilla.org/docs/dom/domref/
                        * Tips for upgrading JavaScript for Netscape 7 / Mozilla
                        * http://www.mozilla.org/docs/web-deve...upgrade_2.html


                        Comment

                        • Dennis

                          #13
                          Re: Netscape 7.1 memory leaks

                          Grant Wagner <gwagner@agrico reunited.com> wrote in message news:<40915FFD. 2E2C958C@agrico reunited.com>.. .[color=blue]
                          > Dennis wrote:
                          >[color=green]
                          > > It seems that garbage collection is somewhat flawed in Netscape as the
                          > > following little script can bring a machine to its knees in about an
                          > > hour when run on Netstcape 7.1. I've tried freeing the variables
                          > > manually, but Im not sure whats broken. I assume that the images
                          > > aren't being freed when they are replaced. Is there a
                          > > workaround/solution to this? I've read some old postings about this in
                          > > 4.x browsers, but I never saw a solution, and its apparently still not
                          > > been repaired.
                          > >
                          > > Dennis
                          > >
                          > > <html>
                          > > <head>
                          > > <script language="JavaS cript">
                          > > var myimage;
                          > >
                          > > function randgen()
                          > > {
                          > > var date = new Date();
                          > >
                          > > return date.getTime();
                          > > }
                          > > function loadIT()
                          > > {
                          > > myimage=new Image;
                          > >
                          > > myimage.src="so meimage.jpg?ran d=" + randgen();
                          > > setTimeout("loa dIT()",1000);
                          > > }
                          > > loadIT();
                          > > </script>
                          > > </head>
                          > > <body>
                          > > </body>
                          > > </html>[/color]
                          >
                          > Garbage collection is a low-priority task. You're creating new objects at
                          > the rate of one a second over an hour. Netscape probably never bothers to
                          > do any garbage collection until the browser is more "idle" then you are
                          > allowing it to be at any point during the execution. As a result it just
                          > continues to request memory from the operating system (which the operating
                          > system is happy to provide up to and beyond the amount of physical memory
                          > present on the system). Once you exceed the amount of physical memory
                          > available, the operating system will begin to swap and you will have
                          > serious performance problems.
                          >
                          > Do you really want everyone using that page to be making requests to your
                          > Web server every second? Since you never display the image I'm guessing
                          > you're using it as some sort of "keep alive" session management or
                          > something? HTTP through a Web browser isn't really the proper medium for
                          > something that requires knowing if the client is connected every second.
                          > You're trying to drive a nail with a screwdriver.
                          >
                          > --
                          > | Grant Wagner <gwagner@agrico reunited.com>[/color]

                          the example provided is designed to accelerate the problem so it
                          happens in a half hour rather than a day.

                          Being able to "drive a nail with a screwdriver" has earned me a pretty
                          good living, and its what sets apart the men from the boys in the
                          programming field. Bad programmers make excuses; Good programmers find
                          solutions.

                          Your management or customers aren't going to care how you got
                          something done, only that the end result works well, is intuitive and
                          doesnt cause a 2Ghz machine to run like an IBM XT (ie Java). It helps,
                          of course, when the tools work as expected.

                          Dennis

                          Comment

                          • Grant Wagner

                            #14
                            Re: Netscape 7.1 memory leaks

                            Dennis wrote:
                            [color=blue][color=green]
                            > > Garbage collection is a low-priority task. You're creating new objects at
                            > > the rate of one a second over an hour. Netscape probably never bothers to
                            > > do any garbage collection until the browser is more "idle" then you are
                            > > allowing it to be at any point during the execution. As a result it just
                            > > continues to request memory from the operating system (which the operating
                            > > system is happy to provide up to and beyond the amount of physical memory
                            > > present on the system). Once you exceed the amount of physical memory
                            > > available, the operating system will begin to swap and you will have
                            > > serious performance problems.
                            > >
                            > > Do you really want everyone using that page to be making requests to your
                            > > Web server every second? Since you never display the image I'm guessing
                            > > you're using it as some sort of "keep alive" session management or
                            > > something? HTTP through a Web browser isn't really the proper medium for
                            > > something that requires knowing if the client is connected every second.
                            > > You're trying to drive a nail with a screwdriver.[/color]
                            >
                            > the example provided is designed to accelerate the problem so it
                            > happens in a half hour rather than a day.
                            >
                            > Being able to "drive a nail with a screwdriver" has earned me a pretty
                            > good living, and its what sets apart the men from the boys in the
                            > programming field. Bad programmers make excuses; Good programmers find
                            > solutions.[/color]

                            And shysters use unreliable hacks to achieve a result until their hack comes unglued, then they blame their
                            tools.
                            [color=blue]
                            > Your management or customers aren't going to care how you got
                            > something done, only that the end result works well, is intuitive and
                            > doesnt cause a 2Ghz machine to run like an IBM XT (ie Java). It helps,
                            > of course, when the tools work as expected.[/color]

                            They also expect it to work long-term and not break with the latest release of the latest "gee whiz" browser.

                            --
                            | Grant Wagner <gwagner@agrico reunited.com>

                            * Client-side Javascript and Netscape 4 DOM Reference available at:
                            * http://devedge.netscape.com/library/...ce/frames.html
                            * Internet Explorer DOM Reference available at:
                            * http://msdn.microsoft.com/workshop/a...ence_entry.asp
                            * Netscape 6/7 DOM Reference available at:
                            * http://www.mozilla.org/docs/dom/domref/
                            * Tips for upgrading JavaScript for Netscape 7 / Mozilla
                            * http://www.mozilla.org/docs/web-deve...upgrade_2.html


                            Comment

                            • Dennis

                              #15
                              Re: Netscape 7.1 memory leaks

                              Grant Wagner <gwagner@agrico reunited.com> wrote in message news:<4092BC86. A4FA234C@agrico reunited.com>.. .[color=blue]
                              > Dennis wrote:
                              >[color=green][color=darkred]
                              > > > Garbage collection is a low-priority task. You're creating new objects at
                              > > > the rate of one a second over an hour. Netscape probably never bothers to
                              > > > do any garbage collection until the browser is more "idle" then you are
                              > > > allowing it to be at any point during the execution. As a result it just
                              > > > continues to request memory from the operating system (which the operating
                              > > > system is happy to provide up to and beyond the amount of physical memory
                              > > > present on the system). Once you exceed the amount of physical memory
                              > > > available, the operating system will begin to swap and you will have
                              > > > serious performance problems.
                              > > >
                              > > > Do you really want everyone using that page to be making requests to your
                              > > > Web server every second? Since you never display the image I'm guessing
                              > > > you're using it as some sort of "keep alive" session management or
                              > > > something? HTTP through a Web browser isn't really the proper medium for
                              > > > something that requires knowing if the client is connected every second.
                              > > > You're trying to drive a nail with a screwdriver.[/color]
                              > >
                              > > the example provided is designed to accelerate the problem so it
                              > > happens in a half hour rather than a day.
                              > >
                              > > Being able to "drive a nail with a screwdriver" has earned me a pretty
                              > > good living, and its what sets apart the men from the boys in the
                              > > programming field. Bad programmers make excuses; Good programmers find
                              > > solutions.[/color]
                              >
                              > And shysters use unreliable hacks to achieve a result until their hack comes unglued, then they blame their
                              > tools.
                              >[color=green]
                              > > Your management or customers aren't going to care how you got
                              > > something done, only that the end result works well, is intuitive and
                              > > doesnt cause a 2Ghz machine to run like an IBM XT (ie Java). It helps,
                              > > of course, when the tools work as expected.[/color]
                              >
                              > They also expect it to work long-term and not break with the latest release of the latest "gee whiz" browser.[/color]

                              I would say that sabotaging a design that will work on 95% of machines
                              to accommodate those stupid enough to use "gee-whiz" browsers is the
                              one whos making the mistake. If you'd rather stand by your square
                              wheel and pound your chest that it "fits any car" good for you, but my
                              round wheel is going to blow yours away. Product design is about
                              making money; about having a better product, not about making
                              universally mediocre widgets.

                              You really dont have a point because Im not trying to do anything out
                              of spec. Nor am I trying to drive a nail with a screwdriver. Netscape
                              just has a plethora of problems, as they always have. We all know it,
                              so why are you agruing against it?

                              Comment

                              Working...