Click here to Skip to main content
15,886,873 members
Home / Discussions / C#
   

C#

 
GeneralRe: IIS Server with C# application Pin
Not Active29-Jun-09 8:30
mentorNot Active29-Jun-09 8:30 
Questionabout full-text-search Pin
leone29-Jun-09 4:43
leone29-Jun-09 4:43 
AnswerRe: about full-text-search Pin
Luc Pattyn29-Jun-09 4:57
sitebuilderLuc Pattyn29-Jun-09 4:57 
QuestionOut of Memory Exception while reading Text File Pin
Revathij29-Jun-09 3:43
Revathij29-Jun-09 3:43 
AnswerRe: Out of Memory Exception while reading Text File Pin
Manas Bhardwaj29-Jun-09 4:19
professionalManas Bhardwaj29-Jun-09 4:19 
AnswerRe: Out of Memory Exception while reading Text File Pin
Keith Barrow29-Jun-09 4:59
professionalKeith Barrow29-Jun-09 4:59 
AnswerRe: Out of Memory Exception while reading Text File Pin
Luc Pattyn29-Jun-09 5:01
sitebuilderLuc Pattyn29-Jun-09 5:01 
AnswerRe: Out of Memory Exception while reading Text File Pin
Dan Neely29-Jun-09 7:19
Dan Neely29-Jun-09 7:19 
Luc is probably right about heap fragmentation being the problem.

Instead of creating new strings with each read and flogging the heap to death like this:


string fileText  ="";

while (strReader.EndOfFile())
{
   fileText += strReader.ReadLine();
}

return fileText;


Use a stringBuilder initialized to the size of the file so that you only have a single memory allocation.


stringBuilder fileText = new stringBuilder(sizeOfFile);

while (strReader.EndOfFile())
{
   fileText.AppendLine(strReader.ReadLine());
}

return fileText;


It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies

QuestionHow to get textbox text lines count? Pin
swetha_insoft29-Jun-09 1:59
swetha_insoft29-Jun-09 1:59 
AnswerRe: How to get textbox text lines count? Pin
padmanabhan N29-Jun-09 2:08
padmanabhan N29-Jun-09 2:08 
GeneralRe: How to get textbox text lines count? Pin
swetha_insoft29-Jun-09 2:19
swetha_insoft29-Jun-09 2:19 
GeneralRe: How to get textbox text lines count? Pin
OriginalGriff29-Jun-09 2:40
mveOriginalGriff29-Jun-09 2:40 
GeneralRe: How to get textbox text lines count? Pin
Pete O'Hanlon29-Jun-09 2:52
mvePete O'Hanlon29-Jun-09 2:52 
AnswerRe: How to get textbox text lines count? Pin
K030629-Jun-09 2:08
K030629-Jun-09 2:08 
AnswerRe: How to get textbox text lines count? Pin
dan!sh 29-Jun-09 2:50
professional dan!sh 29-Jun-09 2:50 
AnswerRe: How to get textbox text lines count? Pin
Henry Minute29-Jun-09 6:03
Henry Minute29-Jun-09 6:03 
Questionhow to use windows service in another project? Pin
Narendra Reddy Vajrala29-Jun-09 1:27
Narendra Reddy Vajrala29-Jun-09 1:27 
AnswerRe: how to use windows service in another project? Pin
himanshu256129-Jun-09 1:50
himanshu256129-Jun-09 1:50 
GeneralRe: how to use windows service in another project? Pin
Narendra Reddy Vajrala29-Jun-09 2:03
Narendra Reddy Vajrala29-Jun-09 2:03 
GeneralRe: how to use windows service in another project? [modified] Pin
himanshu256129-Jun-09 2:13
himanshu256129-Jun-09 2:13 
GeneralRe: how to use windows service in another project? [modified] Pin
Narendra Reddy Vajrala29-Jun-09 2:27
Narendra Reddy Vajrala29-Jun-09 2:27 
GeneralRe: how to use windows service in another project? Pin
himanshu256129-Jun-09 2:36
himanshu256129-Jun-09 2:36 
GeneralRe: Please check this code Pin
Narendra Reddy Vajrala29-Jun-09 2:52
Narendra Reddy Vajrala29-Jun-09 2:52 
GeneralRe: Please check this code Pin
himanshu256129-Jun-09 3:04
himanshu256129-Jun-09 3:04 
GeneralRe: Please check this code Pin
Narendra Reddy Vajrala29-Jun-09 3:11
Narendra Reddy Vajrala29-Jun-09 3:11 

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.