Click here to Skip to main content
15,890,557 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# SqlTransaction Pin
R. Giskard Reventlov14-Feb-13 8:42
R. Giskard Reventlov14-Feb-13 8:42 
GeneralRe: C# SqlTransaction Pin
Hbr_Tha_real14-Feb-13 9:08
Hbr_Tha_real14-Feb-13 9:08 
GeneralRe: C# SqlTransaction Pin
R. Giskard Reventlov14-Feb-13 9:46
R. Giskard Reventlov14-Feb-13 9:46 
GeneralRe: C# SqlTransaction Pin
Hbr_Tha_real14-Feb-13 11:17
Hbr_Tha_real14-Feb-13 11:17 
GeneralRe: C# SqlTransaction Pin
R. Giskard Reventlov14-Feb-13 11:46
R. Giskard Reventlov14-Feb-13 11:46 
QuestionClassic ASP and C# syntax Pin
vanikanc14-Feb-13 8:11
vanikanc14-Feb-13 8:11 
AnswerRe: Classic ASP and C# syntax Pin
vanikanc14-Feb-13 10:54
vanikanc14-Feb-13 10:54 
Questionalphanumeric counter Pin
Angela Scheuvront14-Feb-13 7:41
Angela Scheuvront14-Feb-13 7:41 
AnswerRe: alphanumeric counter Pin
Jibesh14-Feb-13 9:04
professionalJibesh14-Feb-13 9:04 
GeneralRe: alphanumeric counter Pin
Matt T Heffron14-Feb-13 9:28
professionalMatt T Heffron14-Feb-13 9:28 
GeneralRe: alphanumeric counter Pin
Jibesh14-Feb-13 9:29
professionalJibesh14-Feb-13 9:29 
GeneralRe: alphanumeric counter Pin
Matt T Heffron14-Feb-13 9:13
professionalMatt T Heffron14-Feb-13 9:13 
QuestionRe: alphanumeric counter Pin
Matt T Heffron14-Feb-13 9:52
professionalMatt T Heffron14-Feb-13 9:52 
AnswerRe: alphanumeric counter Pin
Angela Scheuvront14-Feb-13 10:15
Angela Scheuvront14-Feb-13 10:15 
GeneralRe: alphanumeric counter Pin
Matt T Heffron14-Feb-13 10:25
professionalMatt T Heffron14-Feb-13 10:25 
GeneralRe: alphanumeric counter Pin
Angela Scheuvront15-Feb-13 1:45
Angela Scheuvront15-Feb-13 1:45 
AnswerRe: alphanumeric counter Pin
Richard Deeming15-Feb-13 1:37
mveRichard Deeming15-Feb-13 1:37 
GeneralRe: alphanumeric counter Pin
Matt T Heffron15-Feb-13 7:39
professionalMatt T Heffron15-Feb-13 7:39 
QuestionStreamWriter.WriteAsync Pin
wizardzz14-Feb-13 6:15
wizardzz14-Feb-13 6:15 
AnswerRe: StreamWriter.WriteAsync Pin
Dave Kreskowiak14-Feb-13 7:31
mveDave Kreskowiak14-Feb-13 7:31 
How big is that freaking StringBuilder?? If you don't specify a size, it starts with 16 characters and allocates a new array internally every time you exceed it's capacity. So, it starts with 16, then goes to 32, 64, 128, 512, 1024, ... when you get into VERY large objects, you can be allocating megabytes of memory and possibly hit a size where the CLR doesn't have a big enough contiguous block of memory to fit the new size.

This also applies when you finally call .ToString on the StringBuilder. A new String object has to be allocated and the data in the StringBuilder copied to it. Again, if sufficiently big, the new String may not fit in memory because of a fragmented large object heap.

The CLR will allocate any object requiring more than 85K (IIRC) out of the LOB. The LOB isn't compacted and defragmented like the Smaller Object Heap is. So if you're allocating and freeing a bunch of large objects, you could be fragmenting the LOB to the point where you can't allocate a new object of the size you need, even though there's enough TOTAL free memory.

But, the way around this little problem using StringBuilder is to allocate the StringBuilder with a size sufficient to hold the entire POSSIBLE string without having it constantly reallocate itself.


Oh! And as for the StreamWriter.WriteAsync, there is no equivilent in any other version of .NET. You'd have to implement an Async version yourself. But, I don't think that has anything to do with your problem right now.

GeneralRe: StreamWriter.WriteAsync Pin
wizardzz14-Feb-13 8:33
wizardzz14-Feb-13 8:33 
GeneralRe: StreamWriter.WriteAsync Pin
wizardzz14-Feb-13 8:55
wizardzz14-Feb-13 8:55 
Questionsingle selection of radio buttons in a table Pin
Member 258173814-Feb-13 4:36
Member 258173814-Feb-13 4:36 
AnswerRe: single selection of radio buttons in a table Pin
Richard MacCutchan14-Feb-13 4:58
mveRichard MacCutchan14-Feb-13 4:58 
AnswerRe: single selection of radio buttons in a table Pin
Alan Balkany14-Feb-13 5:04
Alan Balkany14-Feb-13 5:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.