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 / July 2007

Tip: Looking for answers? Try searching our database.

weak referance

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Artralarasu - 30 Jul 2007 10:54 GMT
what is the advantage of weaf referace?
basically CLR allocate the memory from short/long weak referance table base
and the memory will be collected by the garbage by its rule when the object
is in no longer in reachable state.

but myconcern is in regular way the GC will collect the memory if the object
is no longer needed in weak referance if the GC didnt happen we can reclaim
that memory and we can use it.But MS describes that if we  r going to deal
with larger chunck of memory weak referance will give the better performance
but i am not agree that.All the way its maintainingthe memory in the system
its not actually freeing it from original location.could any one clarify this.

thanks,
artral.
Göran Andersson - 30 Jul 2007 11:55 GMT
> what is the advantage of weaf referace?
> basically CLR allocate the memory from short/long weak referance table base
[quoted text clipped - 10 lines]
> thanks,
> artral.

A weak reference is not considered by the garbage collector as an active
reference. That means that the object may be garbage collected if you
only have weak references to it.

If the heap runs out of unused memory, it will first do a garbage
collection before requesting more memory from the system. If you have
weakly referenced objects, they can be collected, and that will likely
be enough so that no extra memory needs to be allocated from the system
at that time.

Signature

Göran Andersson
_____
http://www.guffa.com


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.