I have a StringBuilder that has a string with 12,000,000 characters.
When I do a ToString(), I expect to have ~25,000,000 bytes worth of
memory, yet, I end up with ~43,000,000 bytes. That's almost double
the size. The string returned from ToString() is actually of size
StringBuilder.C apacity, NOT StringBuilder.L ength. It may have a
end-of-string character at StringBuilder.L ength, but its actual memory
size is StringBuilder.C apacity.
Does this sound right?
When I do a ToString(), I expect to have ~25,000,000 bytes worth of
memory, yet, I end up with ~43,000,000 bytes. That's almost double
the size. The string returned from ToString() is actually of size
StringBuilder.C apacity, NOT StringBuilder.L ength. It may have a
end-of-string character at StringBuilder.L ength, but its actual memory
size is StringBuilder.C apacity.
Does this sound right?
Comment