non contiguous String object C#.net

Posted by Kazoom on Stack Overflow See other posts from Stack Overflow or by Kazoom
Published on 2010-04-19T21:56:08Z Indexed on 2010/04/19 22:13 UTC
Read the original article Hit count: 215

Filed under:
|
|

By what i understand String and StringBuilder objects both allocate contiguous memory underneath.

My program runs for days buffering several output in a String object. This sometimes cause outofmemoryexception which i think is because of non availability of contiguous memory. my string size can go upto 100MBs and i m concatenating new string frequently this causes new string object being allocated. i can reduce new string object creation by using Stringbuilder but that would not solve my problem entirely

Is there an alternative to a contiguous string object?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET