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

C#

 
AnswerRe: Large text file(1.5 gb) reading using Background worker Pin
BillWoodruff23-Dec-13 0:08
professionalBillWoodruff23-Dec-13 0:08 
GeneralRe: Large text file(1.5 gb) reading using Background worker Pin
Arjun Mourya23-Dec-13 3:05
Arjun Mourya23-Dec-13 3:05 
GeneralRe: Large text file(1.5 gb) reading using Background worker Pin
Member 996531123-Dec-13 10:41
Member 996531123-Dec-13 10:41 
AnswerRe: Large text file(1.5 gb) reading using Background worker Pin
Manfred Rudolf Bihy23-Dec-13 0:49
professionalManfred Rudolf Bihy23-Dec-13 0:49 
GeneralRe: Large text file(1.5 gb) reading using Background worker Pin
Arjun Mourya23-Dec-13 2:57
Arjun Mourya23-Dec-13 2:57 
GeneralRe: Large text file(1.5 gb) reading using Background worker Pin
Eddy Vluggen23-Dec-13 7:25
professionalEddy Vluggen23-Dec-13 7:25 
GeneralRe: Large text file(1.5 gb) reading using Background worker Pin
Arjun Mourya24-Dec-13 0:10
Arjun Mourya24-Dec-13 0:10 
AnswerRe: Large text file(1.5 gb) reading using Background worker Pin
OriginalGriff23-Dec-13 1:06
mveOriginalGriff23-Dec-13 1:06 
Firstly, there are two things to notice here:
1) The maximum size of any object in .NET is 2GB - so any contiguous block of memory that the system tries to allocate (regardless of whether you are operating in a 32 or 64 bit environment) must be less than 2GB.
2) StringBuilder works by allocating a chunk of memory and copying your new data into it every time you Append anything. If the space is too small, then the memory buffer is doubled, and the existing content copied in before the new data is added.

So, if you are trying to read 1.5GB, then it will try to allocate memory well and truly in excess of that...Not only will this be pretty slow, but it will need a full 2GB chunk to hold your data, and there will be a lot of Very Large objects created on the way there.

Secondly, how long do you think it is going to take to display 1.5GB of rich text in a RichTextBox? And what earthly use would it be to the user to do that? Do you want to sit there and scroll through that much text looking for the bit you want?

I would very strongly suggest that you reconsider this whole approach, and look at creating something that the user can actually use without wanting to beat you over the head with his keyboard...
GeneralRe: Large text file(1.5 gb) reading using Background worker Pin
Arjun Mourya23-Dec-13 2:50
Arjun Mourya23-Dec-13 2:50 
GeneralRe: Large text file(1.5 gb) reading using Background worker Pin
OriginalGriff23-Dec-13 3:29
mveOriginalGriff23-Dec-13 3:29 
GeneralRe: Large text file(1.5 gb) reading using Background worker Pin
Arjun Mourya23-Dec-13 4:05
Arjun Mourya23-Dec-13 4:05 
GeneralRe: Large text file(1.5 gb) reading using Background worker Pin
OriginalGriff23-Dec-13 4:12
mveOriginalGriff23-Dec-13 4:12 
QuestionRe: Large text file(1.5 gb) reading using Background worker Pin
Sampath Sridhar23-Dec-13 21:48
Sampath Sridhar23-Dec-13 21:48 
AnswerRe: Large text file(1.5 gb) reading using Background worker Pin
OriginalGriff24-Dec-13 0:58
mveOriginalGriff24-Dec-13 0:58 
GeneralRe: Large text file(1.5 gb) reading using Background worker Pin
Arjun Mourya24-Dec-13 2:07
Arjun Mourya24-Dec-13 2:07 
GeneralRe: Large text file(1.5 gb) reading using Background worker Pin
Sampath Sridhar24-Dec-13 6:32
Sampath Sridhar24-Dec-13 6:32 
GeneralRe: Large text file(1.5 gb) reading using Background worker Pin
OriginalGriff24-Dec-13 7:35
mveOriginalGriff24-Dec-13 7:35 
GeneralRe: Large text file(1.5 gb) reading using Background worker Pin
Sampath Sridhar24-Dec-13 19:18
Sampath Sridhar24-Dec-13 19:18 
GeneralRe: Large text file(1.5 gb) reading using Background worker Pin
Arjun Mourya27-Dec-13 1:54
Arjun Mourya27-Dec-13 1:54 
GeneralRe: Large text file(1.5 gb) reading using Background worker Pin
OriginalGriff27-Dec-13 2:12
mveOriginalGriff27-Dec-13 2:12 
GeneralRe: Large text file(1.5 gb) reading using Background worker Pin
Arjun Mourya29-Dec-13 18:10
Arjun Mourya29-Dec-13 18:10 
GeneralRe: Large text file(1.5 gb) reading using Background worker Pin
Arjun Mourya24-Dec-13 0:23
Arjun Mourya24-Dec-13 0:23 
GeneralRe: Large text file(1.5 gb) reading using Background worker Pin
OriginalGriff24-Dec-13 0:33
mveOriginalGriff24-Dec-13 0:33 
GeneralRe: Large text file(1.5 gb) reading using Background worker Pin
harold aptroot24-Dec-13 1:01
harold aptroot24-Dec-13 1:01 
GeneralRe: Large text file(1.5 gb) reading using Background worker Pin
OriginalGriff24-Dec-13 1:12
mveOriginalGriff24-Dec-13 1:12 

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.