locked
best practices : Why and How should I destroy my objects(arrays) in ASP.Net? RRS feed

  • Question

  • User-45396948 posted

     I have been using something like this:

    Dim ArrayA(500) as integer

    ................

     Dim ArrayZ(500) as String

    Do i need to destroy them after usin g.

    IF yes then how?

    Thanks 

    Sunday, April 27, 2008 12:11 PM

All replies

  • User-412902039 posted

    Hi.

    Actually, If you know the architechture of .Net CLR, then there  is a system known as Garbage Collection (GC). The work of GC is to dispose unused memory on program termination / exit.

    If you declare any object then on termination, this will automatically cleared by GC.

    http://www.dotnet-guide.com/garbagecollection.html

    Sunday, April 27, 2008 1:24 PM
  • User-45396948 posted

    Hi,

    I knew it but still i wanted to confirm as i have a little confusion. The system was overloaded while using arrays and remained overload. PF and CPU usage was more than exepected.

    ok, Got the answer.

    Thanks For the link.

     

    Sunday, April 27, 2008 9:32 PM