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

C#

 
AnswerRe: Need sample code Pin
PIEBALDconsult4-Dec-09 4:00
mvePIEBALDconsult4-Dec-09 4:00 
GeneralC# and timer Pin
nsjn3-Dec-09 19:46
nsjn3-Dec-09 19:46 
GeneralRe: C# and timer Pin
The Man from U.N.C.L.E.3-Dec-09 22:14
The Man from U.N.C.L.E.3-Dec-09 22:14 
GeneralRe: C# and timer Pin
Corinna John3-Dec-09 22:18
Corinna John3-Dec-09 22:18 
GeneralRe: C# and timer Pin
PIEBALDconsult4-Dec-09 4:02
mvePIEBALDconsult4-Dec-09 4:02 
GeneralRe: C# and timer Pin
nsjn4-Dec-09 18:56
nsjn4-Dec-09 18:56 
GeneralRe: C# and timer Pin
nsjn4-Dec-09 21:22
nsjn4-Dec-09 21:22 
QuestionLooking for ideas on how to release memory right before a generation 3 garbage collection [modified] Pin
GWBas1c3-Dec-09 19:23
GWBas1c3-Dec-09 19:23 
This is a question for GC experts out there:

[Please don't respond telling me to use Dispose, it's not what I'm looking for.]

I'm currently looking for ideas on how to release memory right before a generation 3 garbage collection. Specifically, I have a bunch of objects that all hold the contents of corresponding files on disk. I'd like to hold as many objects as possible in RAM and only release them as more RAM is needed.

The naive approach is to use a Dictionary of WeakReferences. This is what I'm currently doing, but the problem is that some objects never get out of generation 0, and thus are collected and then re-loaded a few seconds later.

So are there any ideas with regard to getting a good estimate of when a garbage collection is coming so I can move unused objects into WeakReferences?

Some constraints:
1 - My deployment scenario is Mono + Linux, so I can't use the Win32 API, hidden CLR functions, COM, ect, ect.
2 - I'm developing with Visual Studio 2005 Pro. I can't afford VS 2008 Pro, and 2005 has some vital threading features in the debugger that VS 2008 express lacks.

modified on Friday, December 4, 2009 5:32 AM

AnswerRe: Looking for ideas on how to release memory right before a generation 3 garbage collection Pin
Abhinav S3-Dec-09 19:58
Abhinav S3-Dec-09 19:58 
GeneralRe: Looking for ideas on how to release memory right before a generation 3 garbage collection Pin
GWBas1c3-Dec-09 20:28
GWBas1c3-Dec-09 20:28 
AnswerRe: Looking for ideas on how to release memory right before a generation 3 garbage collection Pin
Martin#3-Dec-09 20:38
Martin#3-Dec-09 20:38 
GeneralRe: Looking for ideas on how to release memory right before a generation 3 garbage collection Pin
GWBas1c3-Dec-09 21:01
GWBas1c3-Dec-09 21:01 
GeneralRe: Looking for ideas on how to release memory right before a generation 3 garbage collection Pin
Martin#3-Dec-09 21:20
Martin#3-Dec-09 21:20 
AnswerRe: Looking for ideas on how to release memory right before a generation 3 garbage collection Pin
puri keemti3-Dec-09 22:17
puri keemti3-Dec-09 22:17 
GeneralRe: Looking for ideas on how to release memory right before a generation 3 garbage collection Pin
GWBas1c3-Dec-09 23:32
GWBas1c3-Dec-09 23:32 
GeneralRe: Looking for ideas on how to release memory right before a generation 3 garbage collection Pin
puri keemti3-Dec-09 23:35
puri keemti3-Dec-09 23:35 
GeneralRe: Looking for ideas on how to release memory right before a generation 3 garbage collection Pin
GWBas1c3-Dec-09 23:41
GWBas1c3-Dec-09 23:41 
GeneralRe: Looking for ideas on how to release memory right before a generation 3 garbage collection Pin
puri keemti3-Dec-09 23:50
puri keemti3-Dec-09 23:50 
RantRe: Looking for ideas on how to release memory right before a generation 3 garbage collection Pin
GWBas1c4-Dec-09 0:09
GWBas1c4-Dec-09 0:09 
GeneralRe: Looking for ideas on how to release memory right before a generation 3 garbage collection Pin
Shameel4-Dec-09 0:12
professionalShameel4-Dec-09 0:12 
AnswerRe: Looking for ideas on how to release memory right before a generation 3 garbage collection Pin
Dave Kreskowiak4-Dec-09 3:45
mveDave Kreskowiak4-Dec-09 3:45 
GeneralRe: Looking for ideas on how to release memory right before a generation 3 garbage collection Pin
GWBas1c4-Dec-09 4:02
GWBas1c4-Dec-09 4:02 
AnswerRe: Looking for ideas on how to release memory right before a generation 3 garbage collection Pin
Alan Balkany4-Dec-09 4:15
Alan Balkany4-Dec-09 4:15 
GeneralRe: Looking for ideas on how to release memory right before a generation 3 garbage collection Pin
GWBas1c4-Dec-09 10:43
GWBas1c4-Dec-09 10:43 
AnswerRe: Looking for ideas on how to release memory right before a generation 3 garbage collection Pin
Gideon Engelberth4-Dec-09 4:30
Gideon Engelberth4-Dec-09 4:30 

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.