The Artima Developer Community
Sponsored Link

.NET Buzz Forum
Another reason not to deploy Debug code...

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
douglas reilly

Posts: 108
Nickname: dougreilly
Registered: Oct, 2003

douglas reilly is the owner of Access Microsystems Inc., a small software development consulting fir
Another reason not to deploy Debug code... Posted: Oct 31, 2003 8:52 PM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by douglas reilly.
Original Post: Another reason not to deploy Debug code...
Feed Title: Doug Reilly's Weblog
Feed URL: http://www.asp.net/err404.htm?aspxerrorpath=/dreilly/rss.aspx
Feed Description: ASP.NET and More...
Latest .NET Buzz Posts
Latest .NET Buzz Posts by douglas reilly
Latest Posts From Doug Reilly's Weblog

Advertisement

In the CLR Internals class today, Jeff Richter gave a great deal of really good information.  One thing that I should have figured, but did not really know was about the impact of running Debug code on Garbage Collector performance.  Say you have code like this:

public void foo()
{
   BigOb big;
   big=new BigOb();
   System.Console.WriteLine("Big is Really big! {0} ",big.GetSize());
   // 1.
   LongSlowOperation();
   // 2.
}

The C++ programmer in me says that big will be in scope until just after the curly brace below the comment 2.  Turns out that in release mode, the big object will be available for garbage collection at the 1 comment (because the framework can tell that it is not referenced again in the code) unless the code is debug code.  In that case, the object will be available and not garbage colected as a convenience for you while debugging.  In most cases the difference may not be critical, but it just might in some cases.

Consider yourself warned<g>.

Read: Another reason not to deploy Debug code...

Topic: PDC Bloggers Meeting at Universal Studios Previous Topic   Next Topic Topic: Longhorn Tweaking Guide

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use