Ver Mensaje Individual
  #12 (permalink)  
Antiguo 17/11/2005, 14:31
Avatar de xknown
xknown
 
Fecha de Ingreso: diciembre-2004
Ubicación: Cusco - Perú
Mensajes: 2.248
Antigüedad: 19 años, 4 meses
Puntos: 7
Cita:
Avoid Calling GC.Collect

The default GC.Collect method causes a full collection of all generations. Full collections are expensive because literally every live object in the system must be visited to ensure complete collection. Needless to say, exhaustively visiting all live objects could, and usually does, take a significant amount of time. The garbage collector's algorithm is tuned so that it does full collections only when it is likely to be worth the expense of doing so. As a result, do not call GC.Collect directly — let the garbage collector determine when it needs to run.
The garbage collector is designed to be self-tuning and it adjusts its operation to meet the needs of your application based on memory pressure. Programmatically forcing collection can hinder tuning and operation of the garbage collector.
Les recomiendo la lectura del siguiente capítulo del libro "Improving .NET Application Performance and Scalability" (que lo pueden bajar en formato pdf):
http://msdn.microsoft.com/library/de...netchapt06.asp

Saludos
__________________
Alex Concha
Buayacorp - Programación y Diseño