Recursive setinterval calls a no no in JS.

This is from a page on PHP that used a JS setInterval recursive in their
API, had to disable it.

>From : http://www.tryc.on.ca/archives/php3/1999_4/2409.html

____________________________________________________________________________
_______

It uses the javascript setinterval function to call itself every 50 ms.
However, it overwhelms netscape 4.X garbage collection and causes memory to
start being eaten at a rate of 1 k per second. When we rolled out our stuff
at CSG, it took machines down after 1/2 hour. I fixed most of the problem
by commenting out the setinterval, but then you lose some functionality.


It's a great idea, but Netscape is holding us back.


So, I rewrote our code to do what we needed to in two different JS files.

____________________________________________________________________________
_________






----- Original Message -----
From: "Raymond Smith" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, March 09, 2001 4:57 PM
Subject: Re: [Dynapi-Dev] Garbage Collection


> This is a JS object by Bob Clary that serves as a base object in a JS
> hiarchy, it has an explicit call to destroy() built in with a brief
> discussion as to why it's needed.
>
> http://www.mindspring.com/~bobclary/base/docs/xbObject.html
>
> Class xbObject NameClass xbObject - root of Javascript Class Hierarchy
> Synopsisclass xbObject
> {
>   // constructor
>   xbObject();
>
>   // methods
>   void init();
>   void destroy();
>   Variant parentMethod(String methodName, ...);
>
>   // properties
>   String isa;
>   Object classRef;
> }
>
> Sourcebase/xbObjects.js
>
> See Also_Classes
>
> DescriptionxbObject is the root of the Class hierarchy. It serves as a
means
> of guaranteeing that all classes have the minimal support required. It
also
> is a means of quickly adding new features to all classes. xbObject is not
> intended to be instantiated.
>
> Propertiesisa
> readonly String - Class Name.
>
> classRef
> readonly Object - reference to the entry for this class in the _classes
> object.
>
> MethodsxbObject()
> Constructs an instance of the xbObject class.
>
> Returns nothing
>
> Exceptions
>
> None
>
> destroy()
> Destroy instances of a class. Javascript does not automatically call
> destructors and relies totally upon garbage collection. You must
explicitly
> call destroy if an instance of a class requires destroying. Destructors
are
> especially important in long running scripts that make use of self
> referential data structures which are never automatically garbage
collected.
> To chain destructors, perform any finalization of the current class and
then
> call the parent's destroy method last.
>
> Returns Nothing
>
> Exceptions
>
> None
>
> parentMethod(String methodName, ....)
> Call an overridden method of a parent class. The first argument is the
name
> of the method to be called with the remaining arguments corresponding to
the
> parent's method's arguments. If the parent method returns a value,
> parentMethod will return the value as well.
>
> Returns Variant What ever the parent method returns.
>
> Exceptions
>
> What ever the parent method throws
>
>


_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-dev

Reply via email to