DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Mon, 30 Jul 2007 02:54:02 -0700,    posted on: microsoft.public.dotnet.framework.clr        back       

Thread Index
  1    Artralarasu
          2    Göran Andersson


weak referance   
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.
Date:Mon, 30 Jul 2007 02:54:02 -0700   Author:  

Re: weak referance   
Artralarasu wrote:

> 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.


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.

-- 
Göran Andersson
_____
http://www.guffa.com
Date:Mon, 30 Jul 2007 12:55:21 +0200   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us