What is the most effective way of killing classes?

Results 1 to 4 of 4

Thread: What is the most effective way of killing classes?

  1. #1
    Hank Hepler Guest

    Default What is the most effective way of killing classes?

    When a class is instantiated you need an good way to release the thread. I have seen 2 ways; one is "Set objBlah = Nothing" and "objBlah.Terminate". Which one is better, or should I use both. Just trying to eliminate any unneeded overhead.<BR>Thanks,<BR>Hank

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default RE: What is the most effective way of killing clas

    Well when you set it to nothing the memory held by the object gets released.<BR><BR>the terminate will only work if the obeject HAS that property. All objects do NOT have that property by default.<BR><BR>go with the = nothing

  3. #3
    Join Date
    Dec 1969

    Default What thread???

    First of all, you are "killing" an object, *not* a class. A class is just the "prototype" of an instance thereof, and instances of classes are called objects. Okay, pedantic. Not important.<BR><BR>But...<BR><BR>When you instantiate a class, either a VBS class or a so-called ActiveX object [which is really, again, a prototype of an object] (e.g., via Server.CreateObject), the resultant instantiated object shares the same thread as your VBS/JS code. No new thread is started. So "killing" an object can only release heap memory space, not a thread.<BR><BR>[Yes, I know that you *can* instantiate "out of process" ActiveX components, in which case "killing" the object *can* release an entire other process, which is much more "heavyweight" than just releasing a thread, so if you are using such out of process components it is especially important that you kill them ASAP. But I&#039;d bet bucks that you aren&#039;t doing that. None of the standard components of ASP are out of process.]<BR><BR>

  4. #4
    Join Date
    Dec 1969

    Default RE: What thread???

    Thanks Bill as usual you are right on the money!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts