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

C#

 
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 
Idea: Maintain a queue of strong references to the most recently used objects. This prevents them from being garbage collected. When an object is used, move it to the front of the queue. When you insert a new object at the front of the queue, delete the strong reference at the tail of the queue if the queue size is above a certain threshold.

If recently-referenced objects are more likely to be referenced again, this cache will avoid re-reading them from disk.

An enhancement: Instead of just a plain queue, keep the items in keyed storage (hash table, binary tree, etc), and maintain the queue as a doubly-linked list, implemented by Previous/Next fields in your items. This will let you quickly look up an object which may be in your cache. Adjust the Previous/Next fields to move it to the head of the queue. You'll also want to maintain external pointers to the head and tail of the queue.

Hope this helps.
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 
GeneralRe: Looking for ideas on how to release memory right before a generation 3 garbage collection Pin
GWBas1c4-Dec-09 10:50
GWBas1c4-Dec-09 10:50 
AnswerRe: Looking for ideas on how to release memory right before a generation 3 garbage collection Pin
Natza Mitzi6-Dec-09 10:18
Natza Mitzi6-Dec-09 10:18 
RantRe: Looking for ideas on how to release memory right before a generation 3 garbage collection Pin
GWBas1c6-Dec-09 18:53
GWBas1c6-Dec-09 18:53 
QuestionIs this an acceptable way to make a Control Array? [modified] Pin
Randal Vance Cunanan3-Dec-09 17:22
Randal Vance Cunanan3-Dec-09 17:22 
AnswerRe: Is this an acceptable way to make a Control Array? Pin
Abhinav S3-Dec-09 17:49
Abhinav S3-Dec-09 17:49 
GeneralRe: Is this an acceptable way to make a Control Array? Pin
Randal Vance Cunanan3-Dec-09 17:59
Randal Vance Cunanan3-Dec-09 17:59 
AnswerRe: Is this an acceptable way to make a Control Array? Pin
dan!sh 3-Dec-09 18:29
professional dan!sh 3-Dec-09 18:29 
AnswerRe: Is this an acceptable way to make a Control Array? Pin
GWBas1c3-Dec-09 19:29
GWBas1c3-Dec-09 19:29 
AnswerRe: Is this an acceptable way to make a Control Array? [modified] Pin
puri keemti3-Dec-09 22:22
puri keemti3-Dec-09 22:22 
AnswerRe: Is this an acceptable way to make a Control Array? Pin
Shameel3-Dec-09 23:34
professionalShameel3-Dec-09 23:34 
AnswerRe: Is this an acceptable way to make a Control Array? Pin
freakyit3-Dec-09 23:39
freakyit3-Dec-09 23:39 
AnswerRe: Is this an acceptable way to make a Control Array? Pin
PIEBALDconsult4-Dec-09 4:04
mvePIEBALDconsult4-Dec-09 4:04 
QuestionString Manipulation Pin
CoderOnline3-Dec-09 17:15
CoderOnline3-Dec-09 17:15 
GeneralRe: String Manipulation Pin
Abhinav S3-Dec-09 17:46
Abhinav S3-Dec-09 17:46 
GeneralRe: String Manipulation Pin
CoderOnline3-Dec-09 18:08
CoderOnline3-Dec-09 18:08 

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.