![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a NET CF application running on Mobile 5. The app tries to read a very BIG file (almost 3 Mb) and store its content in a string. I use StreamReader to read the file, and stringbuilder to build the string. However, at some time during this process I get the error: at System.PInvoke.EE.FastAllocateString() at System.String.GetStringForStringBuilder() at System.String.GetStringForStringBuilder() at System.Text.StringBuilder.GetNewString() at System.Text.StringBuilder.Append() at MyProgram.XMLUtils.xmlToString() : : : I've been trying to walk through the code when running this one, but somewhere when the Capacity of my string reaches 117158 the code freezes. I need to build that string so that my CF app can upload that string to a web service application. Now, the application runs fine (without errors) some times; other times it crashes with the OutOfMemoryException, on both cases using the exact same data. The only difference is that: it crashes when the app has been running for a while in the PDA. It does not crash if a start a new session of the app and go straight to create that string to send to the web service. Any ideas on how I can fix this? Oh yes, I have added the lines: GC.Collect(); GC.WaitForPendingFinalizers(); when I instanciate the form that creates this string......and still the thing crashes. :-( |
#3
| |||
| |||
|
|
I have a NET CF application running on Mobile 5. The app tries to read a very BIG file (almost 3 Mb) and store its content in a string. I use StreamReader to read the file, and stringbuilder to build the string. However, at some time during this process I get the error: at System.PInvoke.EE.FastAllocateString() at System.String.GetStringForStringBuilder() at System.String.GetStringForStringBuilder() at System.Text.StringBuilder.GetNewString() at System.Text.StringBuilder.Append() at MyProgram.XMLUtils.xmlToString() : : : I've been trying to walk through the code when running this one, but somewhere when the Capacity of my string reaches 117158 the code freezes. I need to build that string so that my CF app can upload that string to a web service application. Now, the application runs fine (without errors) some times; other times it crashes with the OutOfMemoryException, on both cases using the exact same data. The only difference is that: it crashes when the app has been running for a while in the PDA. It does not crash if a start a new session of the app and go straight to create that string to send to the web service. Any ideas on how I can fix this? Oh yes, I have added the lines: GC.Collect(); GC.WaitForPendingFinalizers(); when I instanciate the form that creates this string......and still the thing crashes. :-( |
#4
| |||
| |||
|
#5
| |||
| |||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |