Click here to Skip to main content
15,925,369 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: Memory allocation / GC issues??? Pin
Luc Pattyn24-Aug-07 5:17
sitebuilderLuc Pattyn24-Aug-07 5:17 
GeneralRe: Memory allocation / GC issues??? Pin
Xpnctoc24-Aug-07 8:54
Xpnctoc24-Aug-07 8:54 
GeneralRe: Memory allocation / GC issues??? Pin
Dave Kreskowiak24-Aug-07 9:01
mveDave Kreskowiak24-Aug-07 9:01 
GeneralRe: Memory allocation / GC issues??? Pin
Lutosław25-Aug-07 21:35
Lutosław25-Aug-07 21:35 
GeneralRe: Memory allocation / GC issues??? Pin
Luc Pattyn25-Aug-07 23:27
sitebuilderLuc Pattyn25-Aug-07 23:27 
GeneralRe: Memory allocation / GC issues??? Pin
Dave Kreskowiak26-Aug-07 4:06
mveDave Kreskowiak26-Aug-07 4:06 
GeneralRe: Memory allocation / GC issues??? Pin
Luc Pattyn24-Aug-07 12:57
sitebuilderLuc Pattyn24-Aug-07 12:57 
AnswerRe: Memory allocation / GC issues??? Pin
Dave Kreskowiak24-Aug-07 6:17
mveDave Kreskowiak24-Aug-07 6:17 
Xpnctoc wrote:
Using Task Manager to monitor my memory use,


Stop right there. You're looking in the wrong place. Managed code (.NET CLR) apps run inside a virtual machine, just like a Java app. What Task Manager is showing you is the RAM reserved for the entire virtual machine your app is running in, not just your app. So, even though your app isn't using that memory, it's still being held by the virtual machine for future use. That's why the memory doesn't get freed.


Xpnctoc wrote:
Is my Garbage Collector broken?


Nope. It's just being lazy. It will hang on to that memory, so long as Windows doesn't want it back. When Windows starts to get low on memory, it'll ask the virtual machine to release whatever it can back to Windows.


Xpnctoc wrote:
Should I somehow manually invoke garbage collection to clear some memory?


This won't solve the "problem". This will tell the GC to free up any managed memory that hasn't already been freed. But, this memory goes back into the Managed Heap (reserved for future use), NOT back to Windows.


Xpnctoc wrote:
Does anyone know if the GC works on a time interval or a certain percentage of consumed memory, or what?


The GC is extremely good at it's job and runs whenever it detects the need to. There is no set schedule and it tunes it's own performance based on how it sees your app running and what it expects your app to do in the future.


A guide to posting questions on CodeProject[^]

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


GeneralRe: Memory allocation / GC issues??? Pin
Xpnctoc24-Aug-07 8:59
Xpnctoc24-Aug-07 8:59 
AnswerRe: Memory allocation / GC issues??? Pin
Luc Pattyn25-Aug-07 0:04
sitebuilderLuc Pattyn25-Aug-07 0:04 
GeneralRe: Memory allocation / GC issues??? Pin
Xpnctoc25-Aug-07 4:14
Xpnctoc25-Aug-07 4:14 
AnswerRe: Memory allocation / GC issues??? Pin
#realJSOP25-Aug-07 3:13
professional#realJSOP25-Aug-07 3:13 
GeneralRe: Memory allocation / GC issues??? Pin
Xpnctoc25-Aug-07 4:14
Xpnctoc25-Aug-07 4:14 
GeneralRe: Memory allocation / GC issues??? Pin
Luc Pattyn25-Aug-07 8:12
sitebuilderLuc Pattyn25-Aug-07 8:12 
GeneralRe: Memory allocation / GC issues??? Pin
Scott Dorman26-Aug-07 3:09
professionalScott Dorman26-Aug-07 3:09 
AnswerRe: Memory allocation / GC issues??? Pin
Vaibhav Sharma26-Aug-07 16:54
Vaibhav Sharma26-Aug-07 16:54 
GeneralRe: Memory allocation / GC issues??? Pin
Xpnctoc26-Aug-07 17:24
Xpnctoc26-Aug-07 17:24 
QuestionEmbedded resources -- pros & cons Pin
Xpnctoc24-Aug-07 4:16
Xpnctoc24-Aug-07 4:16 
AnswerRe: Embedded resources -- pros & cons Pin
Luc Pattyn24-Aug-07 4:54
sitebuilderLuc Pattyn24-Aug-07 4:54 
GeneralRe: Embedded resources -- pros & cons Pin
Xpnctoc24-Aug-07 8:43
Xpnctoc24-Aug-07 8:43 
GeneralRe: Embedded resources -- pros & cons Pin
Luc Pattyn24-Aug-07 12:48
sitebuilderLuc Pattyn24-Aug-07 12:48 
Questionglobal.asax session help Pin
boyindie24-Aug-07 0:32
boyindie24-Aug-07 0:32 
AnswerRe: global.asax session help Pin
saniy24-Aug-07 3:25
saniy24-Aug-07 3:25 
GeneralRe: global.asax session help Pin
boyindie24-Aug-07 3:42
boyindie24-Aug-07 3:42 
Questionvc++.net Books Pin
trinadh_t23-Aug-07 19:40
trinadh_t23-Aug-07 19:40 

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.