Click here to Skip to main content
15,886,873 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to stop an Event Pin
Payam Rastogi14-May-09 11:05
Payam Rastogi14-May-09 11:05 
GeneralRe: How to stop an Event Pin
Dave Kreskowiak14-May-09 17:54
mveDave Kreskowiak14-May-09 17:54 
AnswerRe: How to stop an Event Pin
DaveyM6913-May-09 10:51
professionalDaveyM6913-May-09 10:51 
QuestionSimple Interest Problem Pin
ctreed72813-May-09 10:05
ctreed72813-May-09 10:05 
AnswerRe: Simple Interest Problem Pin
Luc Pattyn13-May-09 10:12
sitebuilderLuc Pattyn13-May-09 10:12 
AnswerRe: Simple Interest Problem Pin
Christian Graus13-May-09 11:20
protectorChristian Graus13-May-09 11:20 
QuestionForce CG Pin
Jammer13-May-09 9:43
Jammer13-May-09 9:43 
AnswerRe: Force CG Pin
Dave Kreskowiak13-May-09 9:55
mveDave Kreskowiak13-May-09 9:55 
Jammer wrote:
Is it worth exploring a forced GC.Collect().


Unless you really know what you're doing and why, no, it's not.


Jammer wrote:
memory jumps to 150Mb and a short time later another seach might only return a few hundred samples. I'm seeing the memory still at around the 150Mb mark


Don't tell me you used TaskManager to determine this! It's lying to you. TM doesn't show you how much memory your app is actually using - it's showing you how much the .NET CLR has allocated to your app - including the rest of the managed heap that your app isn't using. Use PerformanceMonitor and the .NET Memory counters to see your apps actual usage.

You really don't have to worry about memory unless your app is really hanging onto it and not releasing it back to the managed pool. The .nET CLR does a very good job of managing the memory and returning whatever it can back to Windows, whenver Windows needs it.

Allocating object out of the managed pool is always faster than waiting for the CLR to get another block of memory from Windows, adding it to the Managed Heap, then allocating your object. That's why the CLR maintains a pool of memory that your app hasn't used yet.


Jammer wrote:
but as I illustrated above I want to free that RAM as quickly as possible.


You don't have to. It's handled automatically whenever the CLR determines that is has an excessive amount of unused memory in the managed pool or Windows needs it back.


A guide to posting questions on CodeProject[^]



Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic
     2006, 2007, 2008




GeneralRe: Force CG Pin
Jammer13-May-09 10:12
Jammer13-May-09 10:12 
GeneralRe: Force CG Pin
Dave Kreskowiak13-May-09 10:44
mveDave Kreskowiak13-May-09 10:44 
GeneralRe: Force CG Pin
Jammer13-May-09 10:49
Jammer13-May-09 10:49 
GeneralRe: Force CG Pin
Christian Graus13-May-09 11:18
protectorChristian Graus13-May-09 11:18 
GeneralRe: Force CG Pin
Dave Kreskowiak13-May-09 14:24
mveDave Kreskowiak13-May-09 14:24 
AnswerRe: Force CG Pin
Christian Graus13-May-09 11:15
protectorChristian Graus13-May-09 11:15 
GeneralRe: Force CG Pin
Jammer13-May-09 11:23
Jammer13-May-09 11:23 
GeneralRe: Force CG Pin
Christian Graus13-May-09 11:25
protectorChristian Graus13-May-09 11:25 
GeneralRe: Force CG Pin
Jammer13-May-09 11:41
Jammer13-May-09 11:41 
Questionhow to retrieve seconds, minutes and hours out of timer Pin
Aljaz11113-May-09 9:39
Aljaz11113-May-09 9:39 
AnswerRe: how to retrieve seconds, minutes and hours out of timer Pin
OriginalGriff13-May-09 9:52
mveOriginalGriff13-May-09 9:52 
QuestionHelp access image from the internet Pin
Alex_xso13-May-09 9:20
Alex_xso13-May-09 9:20 
AnswerRe: Help access image from the internet Pin
Dave Kreskowiak13-May-09 9:38
mveDave Kreskowiak13-May-09 9:38 
GeneralRe: Help access image from the internet Pin
Alex_xso14-May-09 8:21
Alex_xso14-May-09 8:21 
GeneralRe: Help access image from the internet Pin
Dave Kreskowiak14-May-09 17:51
mveDave Kreskowiak14-May-09 17:51 
QuestionHow does one have mdichildren forms automatically sized to fit the parent form? Pin
Lecutus113-May-09 9:06
Lecutus113-May-09 9:06 
AnswerRe: How does one have mdichildren forms automatically sized to fit the parent form? Pin
DaveyM6913-May-09 10:55
professionalDaveyM6913-May-09 10:55 

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.