Instantiating a class in.NET

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Instantiating a class in.NET

    Hi,

    I have a class in .Net which I instantiate in my code
    behind on one of my aspx pages.

    When I am finished with the instance, what is teh best
    method of taking it out of memory. Should I set it to
    nothing or can I dispose of it?

    Thanks,
    Carl.
    Carl Guest

  2. Similar Questions and Discussions

    1. Pre-Instantiating Item-Renderers
      Hi, I have a datagrid control which uses SWC based custom controls as its item renderers. I noticed that when I scroll up and down, the item...
    2. Instantiating dynamic controls?
      I realize this is an old thread, but I stumbled onto this message and know the answer. instead of : myCanvas.createClassObject...
    3. Null pointer when instantiating CFC
      Hi folks, I'm having a problem on a server, in which attempts to instantiate a CFC result in a null pointer error. I was promoting an...
    4. defining a class/instantiating object inside a method of anotherclass
      Ok, here's what I'm trying to do. I have a class. Inside the class I have a method that reads a text file. In the text file I have a class name and...
    5. instantiating the ASP.DLL
      Is there a way to do a CreateObject("") on the ASP.DLL? TIA Chris
  3. #2

    Default Re: Instantiating a class in.NET

    Set it equal to nothing.
    You shouldn't need any fancy disposal stuff unless the class is holding open
    unusually valuable resources.

    --
    I hope this helps,
    Steve C. Orr, MCSD
    [url]http://Steve.Orr.net[/url]


    "Carl" <carl@nospam.com> wrote in message
    news:922601c35b8b$d7c639e0$a001280a@phx.gbl...
    > Hi,
    >
    > I have a class in .Net which I instantiate in my code
    > behind on one of my aspx pages.
    >
    > When I am finished with the instance, what is teh best
    > method of taking it out of memory. Should I set it to
    > nothing or can I dispose of it?
    >
    > Thanks,
    > Carl.

    Steve C. Orr, MCSD Guest

  4. #3

    Default Re: Instantiating a class in.NET

    True, but it never hurts to be tidy.
    In VB6 you theoretically didn't need to clean things up either, but the
    reality was that sometimes the automatic cleanup didn't work quite as well
    as it claimed.
    It seems to behave better in .NET but I'm still not sure if I trust it 100%.
    Better to be safe than sorry and clean up your own messes.

    --
    I hope this helps,
    Steve C. Orr, MCSD
    [url]http://Steve.Orr.net[/url]


    "Kevin Spencer" <kevin@takempis.com> wrote in message
    news:%23%23Yi3R5WDHA.652@tk2msftngp13.phx.gbl...
    > It isn't necessary to set it to nothing, nor does it have any effect to do
    > so (unlike COM). The object will be up for Garbage Collection as soon as
    it
    > passes out of scope.
    >
    > --
    > HTH,
    >
    > Kevin Spencer
    > Microsoft MVP
    > .Net Developer
    > [url]http://www.takempis.com[/url]
    > Complex things are made up of
    > lots of simple things.
    >
    > "Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message
    > news:uWEIw24WDHA.1536@TK2MSFTNGP11.phx.gbl...
    > > Set it equal to nothing.
    > > You shouldn't need any fancy disposal stuff unless the class is holding
    > open
    > > unusually valuable resources.
    > >
    > > --
    > > I hope this helps,
    > > Steve C. Orr, MCSD
    > > [url]http://Steve.Orr.net[/url]
    > >
    > >
    > > "Carl" <carl@nospam.com> wrote in message
    > > news:922601c35b8b$d7c639e0$a001280a@phx.gbl...
    > > > Hi,
    > > >
    > > > I have a class in .Net which I instantiate in my code
    > > > behind on one of my aspx pages.
    > > >
    > > > When I am finished with the instance, what is teh best
    > > > method of taking it out of memory. Should I set it to
    > > > nothing or can I dispose of it?
    > > >
    > > > Thanks,
    > > > Carl.
    > >
    > >
    >
    >

    Steve C. Orr, MCSD Guest

  5. #4

    Default Re: Instantiating a class in.NET

    Steve,

    Why even bother setting the reference to Nothing? This isn't COM - it won't
    decrement the reference count.

    --
    John Saunders
    Internet Engineer
    [email]john.saunders@surfcontrol.com[/email]


    "Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message
    news:uWEIw24WDHA.1536@TK2MSFTNGP11.phx.gbl...
    > Set it equal to nothing.
    > You shouldn't need any fancy disposal stuff unless the class is holding
    open
    > unusually valuable resources.
    >
    > --
    > I hope this helps,
    > Steve C. Orr, MCSD
    > [url]http://Steve.Orr.net[/url]
    >
    >
    > "Carl" <carl@nospam.com> wrote in message
    > news:922601c35b8b$d7c639e0$a001280a@phx.gbl...
    > > Hi,
    > >
    > > I have a class in .Net which I instantiate in my code
    > > behind on one of my aspx pages.
    > >
    > > When I am finished with the instance, what is teh best
    > > method of taking it out of memory. Should I set it to
    > > nothing or can I dispose of it?
    > >
    > > Thanks,
    > > Carl.
    >
    >

    John Saunders Guest

  6. #5

    Default Re: Instantiating a class in.NET

    My mother always taught me to clean up after myself.
    Old habits die hard.
    :-)

    --
    I hope this helps,
    Steve C. Orr, MCSD
    [url]http://Steve.Orr.net[/url]


    "John Saunders" <john.saunders@surfcontrol.com> wrote in message
    news:OZ2iT35WDHA.1644@TK2MSFTNGP10.phx.gbl...
    > Steve,
    >
    > Why even bother setting the reference to Nothing? This isn't COM - it
    won't
    > decrement the reference count.
    >
    > --
    > John Saunders
    > Internet Engineer
    > [email]john.saunders@surfcontrol.com[/email]
    >
    >
    > "Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message
    > news:uWEIw24WDHA.1536@TK2MSFTNGP11.phx.gbl...
    > > Set it equal to nothing.
    > > You shouldn't need any fancy disposal stuff unless the class is holding
    > open
    > > unusually valuable resources.
    > >
    > > --
    > > I hope this helps,
    > > Steve C. Orr, MCSD
    > > [url]http://Steve.Orr.net[/url]
    > >
    > >
    > > "Carl" <carl@nospam.com> wrote in message
    > > news:922601c35b8b$d7c639e0$a001280a@phx.gbl...
    > > > Hi,
    > > >
    > > > I have a class in .Net which I instantiate in my code
    > > > behind on one of my aspx pages.
    > > >
    > > > When I am finished with the instance, what is teh best
    > > > method of taking it out of memory. Should I set it to
    > > > nothing or can I dispose of it?
    > > >
    > > > Thanks,
    > > > Carl.
    > >
    > >
    >
    >

    Steve C. Orr, MCSD Guest

  7. #6

    Default Re: Instantiating a class in.NET

    Steve,

    Do you clean paper plates before discarding them? Then why set a variable
    to null when it's going to disappear as soon as you leave the scope? :-)

    --
    John Saunders
    Internet Engineer
    [email]john.saunders@surfcontrol.com[/email]


    "Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message
    news:uqPhW85WDHA.2568@tk2msftngp13.phx.gbl...
    > My mother always taught me to clean up after myself.
    > Old habits die hard.
    > :-)
    >
    > --
    > I hope this helps,
    > Steve C. Orr, MCSD
    > [url]http://Steve.Orr.net[/url]
    >
    >
    > "John Saunders" <john.saunders@surfcontrol.com> wrote in message
    > news:OZ2iT35WDHA.1644@TK2MSFTNGP10.phx.gbl...
    > > Steve,
    > >
    > > Why even bother setting the reference to Nothing? This isn't COM - it
    > won't
    > > decrement the reference count.
    > >
    > > --
    > > John Saunders
    > > Internet Engineer
    > > [email]john.saunders@surfcontrol.com[/email]
    > >
    > >
    > > "Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message
    > > news:uWEIw24WDHA.1536@TK2MSFTNGP11.phx.gbl...
    > > > Set it equal to nothing.
    > > > You shouldn't need any fancy disposal stuff unless the class is
    holding
    > > open
    > > > unusually valuable resources.
    > > >
    > > > --
    > > > I hope this helps,
    > > > Steve C. Orr, MCSD
    > > > [url]http://Steve.Orr.net[/url]
    > > >
    > > >
    > > > "Carl" <carl@nospam.com> wrote in message
    > > > news:922601c35b8b$d7c639e0$a001280a@phx.gbl...
    > > > > Hi,
    > > > >
    > > > > I have a class in .Net which I instantiate in my code
    > > > > behind on one of my aspx pages.
    > > > >
    > > > > When I am finished with the instance, what is teh best
    > > > > method of taking it out of memory. Should I set it to
    > > > > nothing or can I dispose of it?
    > > > >
    > > > > Thanks,
    > > > > Carl.
    > > >
    > > >
    > >
    > >
    >
    >

    John Saunders Guest

  8. #7

    Default Re: Instantiating a class in.NET

    I agree that it is not a step that is necessary.
    But in general it's good practice to free memory as soon as you're done with
    it.
    By setting the object to nothing, you're permitting the garbage collector to
    pick it up immediately if it so chooses, rather than forcing it to do the
    deallocation later after the entire page is done processing and it goes
    completely out of scope.
    Granted, this isn't likely to give you major performance increases, but if
    the object is large or holds valuable resources it could theoretically help
    in some circumstances.

    --
    I hope this helps,
    Steve C. Orr, MCSD
    [url]http://Steve.Orr.net[/url]


    "John Saunders" <john.saunders@surfcontrol.com> wrote in message
    news:eOpPSD6WDHA.1632@TK2MSFTNGP11.phx.gbl...
    > Steve,
    >
    > Do you clean paper plates before discarding them? Then why set a variable
    > to null when it's going to disappear as soon as you leave the scope? :-)
    >
    > --
    > John Saunders
    > Internet Engineer
    > [email]john.saunders@surfcontrol.com[/email]
    >
    >
    > "Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message
    > news:uqPhW85WDHA.2568@tk2msftngp13.phx.gbl...
    > > My mother always taught me to clean up after myself.
    > > Old habits die hard.
    > > :-)
    > >
    > > --
    > > I hope this helps,
    > > Steve C. Orr, MCSD
    > > [url]http://Steve.Orr.net[/url]
    > >
    > >
    > > "John Saunders" <john.saunders@surfcontrol.com> wrote in message
    > > news:OZ2iT35WDHA.1644@TK2MSFTNGP10.phx.gbl...
    > > > Steve,
    > > >
    > > > Why even bother setting the reference to Nothing? This isn't COM - it
    > > won't
    > > > decrement the reference count.
    > > >
    > > > --
    > > > John Saunders
    > > > Internet Engineer
    > > > [email]john.saunders@surfcontrol.com[/email]
    > > >
    > > >
    > > > "Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message
    > > > news:uWEIw24WDHA.1536@TK2MSFTNGP11.phx.gbl...
    > > > > Set it equal to nothing.
    > > > > You shouldn't need any fancy disposal stuff unless the class is
    > holding
    > > > open
    > > > > unusually valuable resources.
    > > > >
    > > > > --
    > > > > I hope this helps,
    > > > > Steve C. Orr, MCSD
    > > > > [url]http://Steve.Orr.net[/url]
    > > > >
    > > > >
    > > > > "Carl" <carl@nospam.com> wrote in message
    > > > > news:922601c35b8b$d7c639e0$a001280a@phx.gbl...
    > > > > > Hi,
    > > > > >
    > > > > > I have a class in .Net which I instantiate in my code
    > > > > > behind on one of my aspx pages.
    > > > > >
    > > > > > When I am finished with the instance, what is teh best
    > > > > > method of taking it out of memory. Should I set it to
    > > > > > nothing or can I dispose of it?
    > > > > >
    > > > > > Thanks,
    > > > > > Carl.
    > > > >
    > > > >
    > > >
    > > >
    > >
    > >
    >
    >

    Steve C. Orr, MCSD Guest

  9. #8

    Default Re: Instantiating a class in.NET

    If those are the same Special Circumstances I was in about a year ago (and
    for 15 months) then Good Luck.

    I found a damp sponge to be very effective, if you then wash the sponge in
    hot water...

    --
    John Saunders
    Internet Engineer
    [email]john.saunders@surfcontrol.com[/email]


    "MS News (MS LVP)" <sql_agentman@hotmail.com> wrote in message
    news:OqFo$S6WDHA.1384@TK2MSFTNGP10.phx.gbl...
    > I Rinse Paper Plates Due to special circumstances
    >
    > J
    > "John Saunders" <john.saunders@surfcontrol.com> wrote in message
    > news:eOpPSD6WDHA.1632@TK2MSFTNGP11.phx.gbl...
    > > Steve,
    > >
    > > Do you clean paper plates before discarding them? Then why set a
    variable
    > > to null when it's going to disappear as soon as you leave the scope? :-)
    > >
    > > --
    > > John Saunders
    > > Internet Engineer
    > > [email]john.saunders@surfcontrol.com[/email]
    > >
    > >
    > > "Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message
    > > news:uqPhW85WDHA.2568@tk2msftngp13.phx.gbl...
    > > > My mother always taught me to clean up after myself.
    > > > Old habits die hard.
    > > > :-)
    > > >
    > > > --
    > > > I hope this helps,
    > > > Steve C. Orr, MCSD
    > > > [url]http://Steve.Orr.net[/url]
    > > >
    > > >
    > > > "John Saunders" <john.saunders@surfcontrol.com> wrote in message
    > > > news:OZ2iT35WDHA.1644@TK2MSFTNGP10.phx.gbl...
    > > > > Steve,
    > > > >
    > > > > Why even bother setting the reference to Nothing? This isn't COM -
    it
    > > > won't
    > > > > decrement the reference count.
    > > > >
    > > > > --
    > > > > John Saunders
    > > > > Internet Engineer
    > > > > [email]john.saunders@surfcontrol.com[/email]
    > > > >
    > > > >
    > > > > "Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message
    > > > > news:uWEIw24WDHA.1536@TK2MSFTNGP11.phx.gbl...
    > > > > > Set it equal to nothing.
    > > > > > You shouldn't need any fancy disposal stuff unless the class is
    > > holding
    > > > > open
    > > > > > unusually valuable resources.
    > > > > >
    > > > > > --
    > > > > > I hope this helps,
    > > > > > Steve C. Orr, MCSD
    > > > > > [url]http://Steve.Orr.net[/url]
    > > > > >
    > > > > >
    > > > > > "Carl" <carl@nospam.com> wrote in message
    > > > > > news:922601c35b8b$d7c639e0$a001280a@phx.gbl...
    > > > > > > Hi,
    > > > > > >
    > > > > > > I have a class in .Net which I instantiate in my code
    > > > > > > behind on one of my aspx pages.
    > > > > > >
    > > > > > > When I am finished with the instance, what is teh best
    > > > > > > method of taking it out of memory. Should I set it to
    > > > > > > nothing or can I dispose of it?
    > > > > > >
    > > > > > > Thanks,
    > > > > > > Carl.
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >
    > >
    > >
    >
    >

    John Saunders Guest

  10. #9

    Default Re: Instantiating a class in.NET

    Steve,

    I would want to see some research indicating that this is a good practice
    "in general". Among other things, there may well be more overhead in
    individually setting variables to null than in waiting until they go out of
    scope all at once.

    Also, our brains only have so much bandwidth. I'd rather spend mine on
    writing code which actually _does_ something rather than on remembering to
    figure out when I'm "done with" some variable just so I can give the garbage
    collector a few more milliseconds to clean up a few thousand bytes on a 2Gb
    server system - a few milliseconds it will probably not take advantage of.

    Old folks like me need to be careful not to teach the kids our old bad
    habits - even those which used to be good habits. The world has changed too
    much to remain static. Machines have grown much faster and have larger
    memories, and a lot of the habits I learned as a "kid" just don't matter
    now. If I'd been learning today instead of 25 years ago, I would not have
    been taught to set variables to null after use. I'd wonder what the big deal
    was and why we couldn't just wait the few milliseconds until the end of
    scope to get allow the Garbage Collector to collect this few megabytes in a
    couple of seconds.
    --
    John Saunders (Old Dog)
    Internet Engineer (the New Trick)
    [email]john.saunders@surfcontrol.com[/email]

    "Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message
    news:uBIxdQ6WDHA.2236@TK2MSFTNGP10.phx.gbl...
    > I agree that it is not a step that is necessary.
    > But in general it's good practice to free memory as soon as you're done
    with
    > it.
    > By setting the object to nothing, you're permitting the garbage collector
    to
    > pick it up immediately if it so chooses, rather than forcing it to do the
    > deallocation later after the entire page is done processing and it goes
    > completely out of scope.
    > Granted, this isn't likely to give you major performance increases, but if
    > the object is large or holds valuable resources it could theoretically
    help
    > in some circumstances.
    >
    > --
    > I hope this helps,
    > Steve C. Orr, MCSD
    > [url]http://Steve.Orr.net[/url]
    >
    >
    > "John Saunders" <john.saunders@surfcontrol.com> wrote in message
    > news:eOpPSD6WDHA.1632@TK2MSFTNGP11.phx.gbl...
    > > Steve,
    > >
    > > Do you clean paper plates before discarding them? Then why set a
    variable
    > > to null when it's going to disappear as soon as you leave the scope? :-)
    > >
    > > --
    > > John Saunders
    > > Internet Engineer
    > > [email]john.saunders@surfcontrol.com[/email]
    > >
    > >
    > > "Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message
    > > news:uqPhW85WDHA.2568@tk2msftngp13.phx.gbl...
    > > > My mother always taught me to clean up after myself.
    > > > Old habits die hard.
    > > > :-)
    > > >
    > > > --
    > > > I hope this helps,
    > > > Steve C. Orr, MCSD
    > > > [url]http://Steve.Orr.net[/url]
    > > >
    > > >
    > > > "John Saunders" <john.saunders@surfcontrol.com> wrote in message
    > > > news:OZ2iT35WDHA.1644@TK2MSFTNGP10.phx.gbl...
    > > > > Steve,
    > > > >
    > > > > Why even bother setting the reference to Nothing? This isn't COM -
    it
    > > > won't
    > > > > decrement the reference count.
    > > > >
    > > > > --
    > > > > John Saunders
    > > > > Internet Engineer
    > > > > [email]john.saunders@surfcontrol.com[/email]
    > > > >
    > > > >
    > > > > "Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message
    > > > > news:uWEIw24WDHA.1536@TK2MSFTNGP11.phx.gbl...
    > > > > > Set it equal to nothing.
    > > > > > You shouldn't need any fancy disposal stuff unless the class is
    > > holding
    > > > > open
    > > > > > unusually valuable resources.
    > > > > >
    > > > > > --
    > > > > > I hope this helps,
    > > > > > Steve C. Orr, MCSD
    > > > > > [url]http://Steve.Orr.net[/url]
    > > > > >
    > > > > >
    > > > > > "Carl" <carl@nospam.com> wrote in message
    > > > > > news:922601c35b8b$d7c639e0$a001280a@phx.gbl...
    > > > > > > Hi,
    > > > > > >
    > > > > > > I have a class in .Net which I instantiate in my code
    > > > > > > behind on one of my aspx pages.
    > > > > > >
    > > > > > > When I am finished with the instance, what is teh best
    > > > > > > method of taking it out of memory. Should I set it to
    > > > > > > nothing or can I dispose of it?
    > > > > > >
    > > > > > > Thanks,
    > > > > > > Carl.
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >
    > >
    > >
    >
    >

    John Saunders Guest

  11. #10

    Default Re: Instantiating a class in.NET

    Non-Sense for some servers that are hit by 10s - 100s of thousands of users
    per day
    What about Database Connections?
    What about FileHandles?
    The good old rules still apply
    Machines are faster and we have more RAM but We have more demand on these
    machines
    Things can go out of hand with the new generation
    Think about it for few years

    J
    "John Saunders" <john.saunders@surfcontrol.com> wrote in message
    news:eYOXz18WDHA.1640@TK2MSFTNGP10.phx.gbl...
    > Steve,
    >
    > I would want to see some research indicating that this is a good practice
    > "in general". Among other things, there may well be more overhead in
    > individually setting variables to null than in waiting until they go out
    of
    > scope all at once.
    >
    > Also, our brains only have so much bandwidth. I'd rather spend mine on
    > writing code which actually _does_ something rather than on remembering to
    > figure out when I'm "done with" some variable just so I can give the
    garbage
    > collector a few more milliseconds to clean up a few thousand bytes on a
    2Gb
    > server system - a few milliseconds it will probably not take advantage of.
    >
    > Old folks like me need to be careful not to teach the kids our old bad
    > habits - even those which used to be good habits. The world has changed
    too
    > much to remain static. Machines have grown much faster and have larger
    > memories, and a lot of the habits I learned as a "kid" just don't matter
    > now. If I'd been learning today instead of 25 years ago, I would not have
    > been taught to set variables to null after use. I'd wonder what the big
    deal
    > was and why we couldn't just wait the few milliseconds until the end of
    > scope to get allow the Garbage Collector to collect this few megabytes in
    a
    > couple of seconds.
    > --
    > John Saunders (Old Dog)
    > Internet Engineer (the New Trick)
    > [email]john.saunders@surfcontrol.com[/email]
    >
    > "Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message
    > news:uBIxdQ6WDHA.2236@TK2MSFTNGP10.phx.gbl...
    > > I agree that it is not a step that is necessary.
    > > But in general it's good practice to free memory as soon as you're done
    > with
    > > it.
    > > By setting the object to nothing, you're permitting the garbage
    collector
    > to
    > > pick it up immediately if it so chooses, rather than forcing it to do
    the
    > > deallocation later after the entire page is done processing and it goes
    > > completely out of scope.
    > > Granted, this isn't likely to give you major performance increases, but
    if
    > > the object is large or holds valuable resources it could theoretically
    > help
    > > in some circumstances.
    > >
    > > --
    > > I hope this helps,
    > > Steve C. Orr, MCSD
    > > [url]http://Steve.Orr.net[/url]
    > >
    > >
    > > "John Saunders" <john.saunders@surfcontrol.com> wrote in message
    > > news:eOpPSD6WDHA.1632@TK2MSFTNGP11.phx.gbl...
    > > > Steve,
    > > >
    > > > Do you clean paper plates before discarding them? Then why set a
    > variable
    > > > to null when it's going to disappear as soon as you leave the scope?
    :-)
    > > >
    > > > --
    > > > John Saunders
    > > > Internet Engineer
    > > > [email]john.saunders@surfcontrol.com[/email]
    > > >
    > > >
    > > > "Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message
    > > > news:uqPhW85WDHA.2568@tk2msftngp13.phx.gbl...
    > > > > My mother always taught me to clean up after myself.
    > > > > Old habits die hard.
    > > > > :-)
    > > > >
    > > > > --
    > > > > I hope this helps,
    > > > > Steve C. Orr, MCSD
    > > > > [url]http://Steve.Orr.net[/url]
    > > > >
    > > > >
    > > > > "John Saunders" <john.saunders@surfcontrol.com> wrote in message
    > > > > news:OZ2iT35WDHA.1644@TK2MSFTNGP10.phx.gbl...
    > > > > > Steve,
    > > > > >
    > > > > > Why even bother setting the reference to Nothing? This isn't COM -
    > it
    > > > > won't
    > > > > > decrement the reference count.
    > > > > >
    > > > > > --
    > > > > > John Saunders
    > > > > > Internet Engineer
    > > > > > [email]john.saunders@surfcontrol.com[/email]
    > > > > >
    > > > > >
    > > > > > "Steve C. Orr, MCSD" <Steve@Orr.net> wrote in message
    > > > > > news:uWEIw24WDHA.1536@TK2MSFTNGP11.phx.gbl...
    > > > > > > Set it equal to nothing.
    > > > > > > You shouldn't need any fancy disposal stuff unless the class is
    > > > holding
    > > > > > open
    > > > > > > unusually valuable resources.
    > > > > > >
    > > > > > > --
    > > > > > > I hope this helps,
    > > > > > > Steve C. Orr, MCSD
    > > > > > > [url]http://Steve.Orr.net[/url]
    > > > > > >
    > > > > > >
    > > > > > > "Carl" <carl@nospam.com> wrote in message
    > > > > > > news:922601c35b8b$d7c639e0$a001280a@phx.gbl...
    > > > > > > > Hi,
    > > > > > > >
    > > > > > > > I have a class in .Net which I instantiate in my code
    > > > > > > > behind on one of my aspx pages.
    > > > > > > >
    > > > > > > > When I am finished with the instance, what is teh best
    > > > > > > > method of taking it out of memory. Should I set it to
    > > > > > > > nothing or can I dispose of it?
    > > > > > > >
    > > > > > > > Thanks,
    > > > > > > > Carl.
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >
    > >
    > >
    >
    >

    MS News \(MS LVP\) Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139