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

C#

 
GeneralRe: Looking for a good (¿free? ¿opensource?) library to deal with DXF format Pin
vValkir8-Mar-12 21:57
vValkir8-Mar-12 21:57 
GeneralRe: Looking for a good (¿free? ¿opensource?) library to deal with DXF format Pin
vValkir9-Mar-12 0:22
vValkir9-Mar-12 0:22 
Questioncomopnent need Pin
MohsenSaleh8-Mar-12 4:47
MohsenSaleh8-Mar-12 4:47 
AnswerRe: comopnent need Pin
Eddy Vluggen8-Mar-12 5:00
professionalEddy Vluggen8-Mar-12 5:00 
AnswerRe: comopnent need Pin
Richard MacCutchan8-Mar-12 5:14
mveRichard MacCutchan8-Mar-12 5:14 
QuestionFilestreaming System.OutofMemoryException Pin
Sharonc78-Mar-12 4:38
Sharonc78-Mar-12 4:38 
AnswerRe: Filestreaming System.OutofMemoryException Pin
Eddy Vluggen8-Mar-12 4:57
professionalEddy Vluggen8-Mar-12 4:57 
AnswerRe: Filestreaming System.OutofMemoryException Pin
Luc Pattyn8-Mar-12 5:16
sitebuilderLuc Pattyn8-Mar-12 5:16 
Two possibilities:

1. you really ran out of memory. If your code fails right away, this is a likely cause.

2. a byte array is an object; objects larger than some 80KB get allocated on the "Large Object Heap". That heap does not get compacted, hence it may become a subject of fragmentation, which in turn could result in a big memory block not being available although maybe lots of smaller ones are. If your code succeeds a couple of times, and then starts to fail, this is a likely cause.

Now, as Eddy said, why do you want all that data in memory at once? Do you really need that, or are you just being lazy?

BTW: the line byte[] fileData=File.ReadAllBytes(openFileDialog.FullName); could easily replace six of your statements (assuming having all the data at once is really necessary). Notice how the word "Stream" did not show, as streaming means consuming data in chuncks, not getting it all in one. Your code is an example of "stream abuse".

Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum

GeneralRe: Filestreaming System.OutofMemoryException Pin
Sharonc78-Mar-12 9:45
Sharonc78-Mar-12 9:45 
AnswerRe: Filestreaming System.OutofMemoryException Pin
Luc Pattyn8-Mar-12 10:04
sitebuilderLuc Pattyn8-Mar-12 10:04 
GeneralRe: Filestreaming System.OutofMemoryException Pin
jschell9-Mar-12 5:32
jschell9-Mar-12 5:32 
AnswerRe: Filestreaming System.OutofMemoryException Pin
Bernhard Hiller8-Mar-12 22:01
Bernhard Hiller8-Mar-12 22:01 
GeneralRe: Filestreaming System.OutofMemoryException Pin
Sharonc79-Mar-12 3:23
Sharonc79-Mar-12 3:23 
AnswerRe: Filestreaming System.OutofMemoryException Pin
jschell9-Mar-12 5:36
jschell9-Mar-12 5:36 
QuestionSet position in file and read from position Pin
Mc_Topaz8-Mar-12 3:14
Mc_Topaz8-Mar-12 3:14 
AnswerRe: Set position in file and read from position Pin
OriginalGriff8-Mar-12 3:55
mveOriginalGriff8-Mar-12 3:55 
AnswerRe: Set position in file and read from position Pin
PIEBALDconsult8-Mar-12 4:02
mvePIEBALDconsult8-Mar-12 4:02 
Questiondatagridview c# Pin
missoby8-Mar-12 3:11
missoby8-Mar-12 3:11 
AnswerRe: datagridview c# Pin
BobJanova8-Mar-12 3:22
BobJanova8-Mar-12 3:22 
GeneralRe: datagridview c# Pin
missoby8-Mar-12 3:35
missoby8-Mar-12 3:35 
GeneralRe: datagridview c# Pin
BobJanova8-Mar-12 3:44
BobJanova8-Mar-12 3:44 
GeneralRe: datagridview c# Pin
Caleb McElrath8-Mar-12 14:12
professionalCaleb McElrath8-Mar-12 14:12 
AnswerRe: datagridview c# Pin
PIEBALDconsult8-Mar-12 4:07
mvePIEBALDconsult8-Mar-12 4:07 
Questionimage proccessing Pin
mohammadhamid8-Mar-12 0:16
mohammadhamid8-Mar-12 0:16 
AnswerRe: image proccessing Pin
Abhinav S8-Mar-12 1:04
Abhinav S8-Mar-12 1: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.