Re: C# System.String Memory Usage
- From: "Shawn B." <leabre@xxxxxxxx>
- Date: Mon, 18 Dec 2006 11:38:41 -0800
calling GC.Collect is not a good solution. The .NET Framework calls those
methods when necessary, calling it manually will hardly do anything useful
(but some bad things...).
While this might be true (in general) I have a project that actually
improves scalability and performance by calling GC.Collect at the right
place. Without doing so, we can only get about N number of connections
(TCP/IP) on a single server. By doing so, we get about N*5 without a single
noticeable degradation of performance. There's also another place where we
have lots of string handling where placing a GC.Collect in the right place
drastically increases our perceivable performance.
But I agree with you, in general, there probly is a better way. But that
doesn't mean to rule out the possibility. Just because everyone says not
to, doesn't mean you shouldn't see for yourself whether doing so might help
your situation. Of course, this also assumes you understand more about the
GC/JIT/CLR internals than most others do. It also asummes you are a master
of profiling so you can determine whether it helps or not.
YMMV.
Thanks,
Shawn
.
- Follow-Ups:
- Re: C# System.String Memory Usage [TCP IP Connections]
- From: Chris Mullins
- Re: C# System.String Memory Usage [TCP IP Connections]
- References:
- C# System.String Memory Usage
- From: mwhalber
- Re: C# System.String Memory Usage
- From: John Saunders
- Re: C# System.String Memory Usage
- From: Shawn B.
- Re: C# System.String Memory Usage
- From: Henning Krause [MVP - Exchange]
- C# System.String Memory Usage
- Prev by Date: Re: C# System.String Memory Usage
- Next by Date: Re: # of current physical Threads > 4 000 000 0000
- Previous by thread: Re: C# System.String Memory Usage
- Next by thread: Re: C# System.String Memory Usage [TCP IP Connections]
- Index(es):
Relevant Pages
|