Click here to Skip to main content
16,020,519 members
Home / Discussions / C#
   

C#

 
GeneralRe: Syste.OutOfMemoryException Pin
Luc Pattyn11-Mar-09 16:06
sitebuilderLuc Pattyn11-Mar-09 16:06 
GeneralRe: Syste.OutOfMemoryException Pin
DaveyM6911-Mar-09 23:03
professionalDaveyM6911-Mar-09 23:03 
GeneralRe: Syste.OutOfMemoryException Pin
Member 461797111-Mar-09 15:06
Member 461797111-Mar-09 15:06 
GeneralRe: Syste.OutOfMemoryException Pin
Luc Pattyn11-Mar-09 15:13
sitebuilderLuc Pattyn11-Mar-09 15:13 
GeneralRe: Syste.OutOfMemoryException Pin
Member 461797111-Mar-09 15:16
Member 461797111-Mar-09 15:16 
GeneralRe: Syste.OutOfMemoryException [modified] Pin
Luc Pattyn11-Mar-09 15:49
sitebuilderLuc Pattyn11-Mar-09 15:49 
GeneralRe: Syste.OutOfMemoryException Pin
Member 461797111-Mar-09 16:53
Member 461797111-Mar-09 16:53 
GeneralRe: Syste.OutOfMemoryException Pin
Luc Pattyn11-Mar-09 16:10
sitebuilderLuc Pattyn11-Mar-09 16:10 
Hi,

the FileStreamEx class has a ReadText method that creates a MemoryStream but never disposes of it.
That is bad. I suggest you replace line 90
return GetEncoding(TEncoding).GetString(MStream.ToArray());


by

string result=GetEncoding(TEncoding).GetString(MStream.ToArray());
MStream.Dispose();
return result;


It is likely that will dramatically improve the situation.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets


GeneralRe: Syste.OutOfMemoryException Pin
Member 461797111-Mar-09 16:55
Member 461797111-Mar-09 16:55 
GeneralRe: Syste.OutOfMemoryException Pin
Luc Pattyn11-Mar-09 17:13
sitebuilderLuc Pattyn11-Mar-09 17:13 
GeneralRe: Syste.OutOfMemoryException Pin
Member 461797111-Mar-09 17:48
Member 461797111-Mar-09 17:48 
AnswerRe: Syste.OutOfMemoryException Pin
Ennis Ray Lynch, Jr.11-Mar-09 19:46
Ennis Ray Lynch, Jr.11-Mar-09 19:46 
QuestionSetting Form2's start position as Form1's last position Pin
Paulo Toureiro11-Mar-09 13:05
Paulo Toureiro11-Mar-09 13:05 
AnswerRe: Setting Form2's start position as Form1's last position Pin
DaveyM6911-Mar-09 13:21
professionalDaveyM6911-Mar-09 13:21 
GeneralRe: Setting Form2's start position as Form1's last position Pin
Paulo Toureiro11-Mar-09 13:40
Paulo Toureiro11-Mar-09 13:40 
GeneralRe: Setting Form2's start position as Form1's last position Pin
Expert Coming11-Mar-09 14:16
Expert Coming11-Mar-09 14:16 
GeneralRe: Setting Form2's start position as Form1's last position Pin
Paulo Toureiro11-Mar-09 14:21
Paulo Toureiro11-Mar-09 14:21 
GeneralRe: Setting Form2's start position as Form1's last position Pin
DaveyM6911-Mar-09 14:31
professionalDaveyM6911-Mar-09 14:31 
GeneralRe: Setting Form2's start position as Form1's last position Pin
Paulo Toureiro11-Mar-09 14:40
Paulo Toureiro11-Mar-09 14:40 
GeneralRe: Setting Form2's start position as Form1's last position Pin
DaveyM6911-Mar-09 14:49
professionalDaveyM6911-Mar-09 14:49 
QuestionUsing Generic Method to Determine if All Elements in an Array is Zero Pin
mfcuser11-Mar-09 12:17
mfcuser11-Mar-09 12:17 
AnswerRe: Using Generic Method to Determine if All Elements in an Array is Zero Pin
Christian Graus11-Mar-09 12:27
protectorChristian Graus11-Mar-09 12:27 
AnswerRe: Using Generic Method to Determine if All Elements in an Array is Zero Pin
Adam Maras11-Mar-09 12:27
Adam Maras11-Mar-09 12:27 
GeneralRe: Using Generic Method to Determine if All Elements in an Array is Zero Pin
mfcuser11-Mar-09 12:47
mfcuser11-Mar-09 12:47 
GeneralRe: Using Generic Method to Determine if All Elements in an Array is Zero Pin
Adam Maras11-Mar-09 13:32
Adam Maras11-Mar-09 13:32 

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.