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

C#

 
QuestionLinq on Visual 2005 Pin
Berlus29-Nov-07 23:39
Berlus29-Nov-07 23:39 
AnswerRe: Linq on Visual 2005 Pin
Colin Angus Mackay30-Nov-07 0:22
Colin Angus Mackay30-Nov-07 0:22 
AnswerRe: Linq on Visual 2005 Pin
Pete O'Hanlon30-Nov-07 0:26
mvePete O'Hanlon30-Nov-07 0:26 
AnswerRe: Linq on Visual 2005 Pin
Frank Kerrigan30-Nov-07 0:36
Frank Kerrigan30-Nov-07 0:36 
QuestionCreating Website in SharePoint using C#/ASP.NET Pin
md Nazeem29-Nov-07 23:37
md Nazeem29-Nov-07 23:37 
Questionopen an Excel file using c# Pin
ramyanaidu29-Nov-07 23:37
ramyanaidu29-Nov-07 23:37 
AnswerRe: open an Excel file using c# Pin
NewToAspDotNet30-Nov-07 0:35
NewToAspDotNet30-Nov-07 0:35 
Question"out of memory" exception and resource management Pin
metalion29-Nov-07 23:14
metalion29-Nov-07 23:14 
Hi
I'm developing a tool that manages a lot of bitmaps, and very big ones; at some point it hits the 1gb limit that all windows apps have and it causes an "out of memory" exception.

The out of memory exception is expected due to the amount of bitmaps loaded, no memory leaks nor bad memory management.

I developed a "image server" that loads the images on demand, and if it hits an out of memory exception, it is able to temporarily release least recently used images.

Now, what I would like to do (and I have absolutely no idea on how to do it), is to capture the "out of memory" exception for the whole application, essentially, these are the events I would like to control:

- somewhere in the application an amount of memory is requested
- there's not enough memory and an "out of memory" exception is thrown
- "somehow", trap the exception, and call the image server to free some resources
- retry again the allocation, and if successful, continue executing the app normally.
- if the retry fail, try again to free some more resources (if possible), and if it is not possible, finally throw the "out of memory" exception.

Is this possible? I'm pretty new to C#, but I guess that, since the GC is in charge of managing the memory, trapping the memory allocation exception should have to be done through the GC api, right?

Thanks in advance

AnswerRe: "out of memory" exception and resource management Pin
Christian Graus29-Nov-07 23:17
protectorChristian Graus29-Nov-07 23:17 
GeneralRe: "out of memory" exception and resource management Pin
metalion29-Nov-07 23:23
metalion29-Nov-07 23:23 
AnswerRe: "out of memory" exception and resource management Pin
Luc Pattyn30-Nov-07 0:45
sitebuilderLuc Pattyn30-Nov-07 0:45 
GeneralRe: "out of memory" exception and resource management Pin
metalion30-Nov-07 1:25
metalion30-Nov-07 1:25 
QuestionIDeviceContext OR How to MeasureText out of the Paint Event Pin
C-Scharbe29-Nov-07 23:04
C-Scharbe29-Nov-07 23:04 
AnswerRe: IDeviceContext OR How to MeasureText out of the Paint Event Pin
C-Scharbe30-Nov-07 1:04
C-Scharbe30-Nov-07 1:04 
GeneralRe: IDeviceContext OR How to MeasureText out of the Paint Event Pin
mav.northwind30-Nov-07 21:05
mav.northwind30-Nov-07 21:05 
QuestionImpersonation in C# Pin
dhanashree_129-Nov-07 23:02
dhanashree_129-Nov-07 23:02 
QuestionReplacing ReportViewer with Internet Explorer Pin
Ramith Sivanarain29-Nov-07 23:02
Ramith Sivanarain29-Nov-07 23:02 
QuestionExternal device Pin
Lol2129-Nov-07 23:01
Lol2129-Nov-07 23:01 
AnswerRe: External device Pin
MickCurley29-Nov-07 23:10
MickCurley29-Nov-07 23:10 
AnswerRe: External device Pin
ChandraRam30-Nov-07 1:59
ChandraRam30-Nov-07 1:59 
QuestionProblem in opening an excel file using C# Pin
ramyanaidu29-Nov-07 22:54
ramyanaidu29-Nov-07 22:54 
AnswerRe: Problem in opening an excel file using C# Pin
NewToAspDotNet29-Nov-07 23:53
NewToAspDotNet29-Nov-07 23:53 
Question.net 2005 clickonce error Pin
arkiboys29-Nov-07 22:47
arkiboys29-Nov-07 22:47 
GeneralRe: .net 2005 clickonce error Pin
Sam Xavier17-Jan-08 23:56
Sam Xavier17-Jan-08 23:56 
Questioncounting Attributes in xml file of one childnode [modified] Pin
Ravi Shankar4329-Nov-07 22:37
Ravi Shankar4329-Nov-07 22:37 

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.