Groups | Blog | Home
all groups > dotnet performance > september 2006 >

dotnet performance : GC change in .NET 2.0?


BilalD
9/7/2006 5:55:04 PM
I have the following code in VS2003

private EventHandlerList list;
private System.Timers.Timer timer1;

private delegate void mydelegate(object sender);
private Guid guid;


private void timer1_Tick(object sender, EventArgs e)
{
guid = new Guid();
mydelegate handler = new mydelegate(Hullo);

list.AddHandler(guid,handler );
list.RemoveHandler(guid, handler);
}

void Hullo(object sender)
{
}

This is part of a larger app, but the idea here is to add and remove the
delegate from EventListHandler in a timer that fires 50ms. I could use a loop
here as well. In .NEt 1.1, the memory for this app would eventually
stabilize. But the memory for the same app built in VS2005 grows unbounded.
It went from 12MB to 30 MB in 2 hours while the same thing in 2003 hovered
around 9MB. I was measuring the private bytes of the app via the performance
counters under administrative tools.

Has anyone seen this? Am i doing something silly here? I don't want to call
GC Collect since I did not have to earlier.

Calvin Luttrell
9/9/2006 7:53:33 PM
With out seeing the rest of the application it's hard to say is another part
of the application isn't causing an the memory usage to increase. However
..Net applications use a lot of memory. I find it's better to load them last
after all other applications have been opened since the available memory
seems to mildly effect the memory management.


Calvin Luttrell

How e-commerce is done.

http://blog.projectthunder.com
http://www.projectthunder.com



[quoted text, click to view]

AddThis Social Bookmark Button