Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / June 2004

Tip: Looking for answers? Try searching our database.

Doubt about Garbage collection

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Shiva - 24 Jun 2004 13:27 GMT
Hi

I am writing a chat application
I have developed the chat server in which i am creating objects that represents the communicating parties and those will stay in memory till there is communication between them

when they logout i need to destroy the object from the memory

Because the application will run forever theoritically i fear that the objects will get accumulated in memory if i dont destroy them

Can i destroy the object by setting to NOTHING?
Will it destroy the object?

should i run GC from my code?

What shall i do to get these objects out of memory?

Thanks
Shiva
cody - 24 Jun 2004 13:37 GMT
GC will run automatically every few minutes or if memory is low. You can run
it manually by calling GC.Collect() but this is generally not recommended.
GC will collect all objects automatically which are not referenced from
somewhere.
If you want to destroy an object set all references to it to null and remove
the objects from all lists or arrays if you store your object in such a
collection.

--
cody

Freeware Tools, Games and Humour
http://www.deutronium.de.vu  || http://www.deutronium.tk
> Hi
>
> I am writing a chat application
> I have developed the chat server in which i am creating objects that represents the communicating parties and those will stay in memory till
there is communication between them

> when they logout i need to destroy the object from the memory
>
[quoted text clipped - 9 lines]
> Thanks
> Shiva

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.