Click here to Skip to main content
15,887,214 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to minimize the garbage collector running .. ? PinPopular
Łukasz Nowakowski18-Aug-10 23:45
Łukasz Nowakowski18-Aug-10 23:45 
AnswerRe: How to minimize the garbage collector running .. ? Pin
DaveyM6918-Aug-10 23:59
professionalDaveyM6918-Aug-10 23:59 
AnswerRe: How to minimize the garbage collector running .. ? Pin
Luc Pattyn19-Aug-10 2:26
sitebuilderLuc Pattyn19-Aug-10 2:26 
AnswerRe: How to minimize the garbage collector running .. ? Pin
Ennis Ray Lynch, Jr.19-Aug-10 3:24
Ennis Ray Lynch, Jr.19-Aug-10 3:24 
AnswerRe: How to minimize the garbage collector running .. ? Pin
#realJSOP19-Aug-10 3:44
mve#realJSOP19-Aug-10 3:44 
AnswerRe: How to minimize the garbage collector running .. ? Pin
Paul Michalik20-Aug-10 22:38
Paul Michalik20-Aug-10 22:38 
GeneralRe: How to minimize the garbage collector running .. ? Pin
Yanshof21-Aug-10 7:25
Yanshof21-Aug-10 7:25 
GeneralRe: How to minimize the garbage collector running .. ? Pin
Paul Michalik21-Aug-10 22:59
Paul Michalik21-Aug-10 22:59 
No, on the contrary, at least if we are talking about System.Drawing.Bitmap. This one implements IDisposable and allows you to explicitely release the resources and to notify the GC that there is no need to finalize this object.

It depends a lot on the scenario in which you are using it:

If you create a Bitmap and use it in a local scope, use the using syntax:
using (Bitmap tB = new Bitmap(...)) {
  // use tB here...
}


If you need to keep references to Bitmap object (as you apparently do), then take care that after calling Bitmap.Dispose no reference to that object exists in your program. Assuming your Bitmap container is a Queue<Bitmap>:

//... this is the "end of use of bitmap"
using (Bitmap tB = BitmapQueue.Dequeue());
//... tB is now disposed, and won't be finalized
//... The Queue is the only place to store Bitmaps

QuestionCheck Broken File Pin
dataminers18-Aug-10 22:41
dataminers18-Aug-10 22:41 
AnswerRe: Check Broken File Pin
R. Giskard Reventlov18-Aug-10 22:49
R. Giskard Reventlov18-Aug-10 22:49 
GeneralRe: Check Broken File Pin
dataminers19-Aug-10 0:34
dataminers19-Aug-10 0:34 
GeneralRe: Check Broken File Pin
R. Giskard Reventlov19-Aug-10 0:52
R. Giskard Reventlov19-Aug-10 0:52 
GeneralRe: Check Broken File Pin
Eddy Vluggen19-Aug-10 4:55
professionalEddy Vluggen19-Aug-10 4:55 
AnswerRe: Check Broken File Pin
Eddy Vluggen19-Aug-10 5:00
professionalEddy Vluggen19-Aug-10 5:00 
QuestionBind sql print statement to dropdown Pin
SatyaKeerthi1518-Aug-10 20:31
SatyaKeerthi1518-Aug-10 20:31 
QuestionAdd control to listview Pin
VCsamir18-Aug-10 20:11
VCsamir18-Aug-10 20:11 
AnswerRe: Add control to listview Pin
Bernhard Hiller18-Aug-10 20:24
Bernhard Hiller18-Aug-10 20:24 
AnswerRe: Add control to listview Pin
Rhuros18-Aug-10 22:12
professionalRhuros18-Aug-10 22:12 
QuestionHow to do binding DomainUpDown control to some variable ? [modified] Pin
Yanshof18-Aug-10 18:31
Yanshof18-Aug-10 18:31 
Questionneed help to transfer from java-script to C# Pin
goldsoft18-Aug-10 8:42
goldsoft18-Aug-10 8:42 
AnswerRe: need help to transfer from java-script to C# Pin
Not Active18-Aug-10 9:05
mentorNot Active18-Aug-10 9:05 
AnswerRe: need help to transfer from java-script to C# Pin
Abhishek Sur18-Aug-10 10:06
professionalAbhishek Sur18-Aug-10 10:06 
AnswerRe: need help to transfer from java-script to C# Pin
Ravi Sant12-May-11 1:10
Ravi Sant12-May-11 1:10 
QuestionReflection - dynamically adding custom attributes Pin
imak18-Aug-10 8:10
imak18-Aug-10 8:10 
AnswerRe: Reflection - dynamically adding custom attributes Pin
Not Active18-Aug-10 8:43
mentorNot Active18-Aug-10 8:43 

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.