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

C#

 
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 
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 
Sounds like a fragmentation issue then; and that could be tough, it may well be a fundamental weakness of the .NET memory management.


Sharonc7 wrote:
Normally I will only be loading one file at a time
Is that one file per run? if so, nothing needs to be done.

Otherwise "solutions" are (pick one or more):
1. when it happens, restart your app;
2. organize things so that you don't need those large objects, or at least reduce their number;
3. make sure you free the large objects as soon as you don't need them any more (and before allocating more of them). This may involve setting a reference to null AND calling GC.Collect() explicitly (which under normal circumstances should better not be done).
4. organize memory reuse, rather than forgetting about stale objects and allocating new ones. However, this can't be done for methods that return a (new) large object, such as your stream.Read or my File.ReadAllBytes.
Luc Pattyn [My Articles] Nil Volentibus Arduum

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 
AnswerRe: image proccessing Pin
Dave Kreskowiak8-Mar-12 3:23
mveDave Kreskowiak8-Mar-12 3:23 
Questionhow to communicate to usb port programically? Pin
neodeaths8-Mar-12 0:10
neodeaths8-Mar-12 0:10 

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.