Re: C# System.String Memory Usage



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


.



Relevant Pages

  • Re: Encryption ??
    ... His TEA_encrypt and TEA_decrypt was done so that he would have a complete program to encrypt and decrypt data longer than 8-bytes. ... If his calling convention was fixed we would have clipper calling a wrapper through the expand.api, calling what's essentially a routine to handle streams longer than 64-bits that calls the real algorithm -- a 4-step process. ... I don't seem any real problem in the string handling even though it has the "potential" for buffer overflow. ...
    (comp.lang.clipper)
  • Re: How are arguments a legit argument to Array.slice?
    ... This gives approximatly the same effect as placing the function ... as a method of the arguments object and calling it. ... and thus that is the context of the function call on ...
    (comp.lang.javascript)
  • Re: keeping computer on 2/24
    ... time on chitters like you by ... placing you on my troll killfile. ... Calling an illegal alien an "undocumented worker" is like calling a ...
    (microsoft.public.windowsxp.help_and_support)