Click here to Skip to main content
15,888,351 members
Home / Discussions / C#
   

C#

 
GeneralRe: Large memory usage. Pin
Luc Pattyn8-Apr-09 15:15
sitebuilderLuc Pattyn8-Apr-09 15:15 
GeneralRe: Large memory usage. Pin
Jacob Dixon8-Apr-09 16:52
Jacob Dixon8-Apr-09 16:52 
GeneralRe: Large memory usage. Pin
Luc Pattyn8-Apr-09 17:17
sitebuilderLuc Pattyn8-Apr-09 17:17 
GeneralRe: Large memory usage. Pin
harold aptroot8-Apr-09 15:35
harold aptroot8-Apr-09 15:35 
GeneralRe: Large memory usage. Pin
Luc Pattyn8-Apr-09 15:58
sitebuilderLuc Pattyn8-Apr-09 15:58 
GeneralRe: Large memory usage. Pin
harold aptroot8-Apr-09 16:37
harold aptroot8-Apr-09 16:37 
GeneralRe: Large memory usage. Pin
Luc Pattyn8-Apr-09 17:05
sitebuilderLuc Pattyn8-Apr-09 17:05 
GeneralRe: Large memory usage. Pin
Dave Kreskowiak8-Apr-09 17:47
mveDave Kreskowiak8-Apr-09 17:47 
harold aptroot wrote:
then let me ask it like this, how should I do "the same"?


You don't. You're worried about something that happens completely automatically. The .NET CLR does a very good job of managing memory. If your code frees a bunch of objects, the memory isn't freed immediately. The Garbage Collector gets around to freeing them eventually, whenever it needs to. When an object is finally freed, the memory is returned to the Managed Memory Pool. The reason it doesn't get returned to Windows immediately is because future allocations are faster out of the Managed Pool if there is sufficient memory in the pool. If not, the memory manager has to go to Windows to allocate another block of memory, add it to the pool, then allocate the new object. Now, if Windows needs the memory back, the .NET CLR is more than happy to remove any free memory from the Managed Pool and return it to Windows - entirely automatically. You don't have to do anything.


A guide to posting questions on CodeProject[^]



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




GeneralRe: Large memory usage. Pin
harold aptroot9-Apr-09 4:59
harold aptroot9-Apr-09 4:59 
GeneralRe: Large memory usage. Pin
Dave Kreskowiak9-Apr-09 13:16
mveDave Kreskowiak9-Apr-09 13:16 
GeneralRe: Large memory usage. Pin
harold aptroot9-Apr-09 13:38
harold aptroot9-Apr-09 13:38 
GeneralRe: Large memory usage. Pin
S. Senthil Kumar8-Apr-09 23:03
S. Senthil Kumar8-Apr-09 23:03 
GeneralRe: Large memory usage. Pin
harold aptroot9-Apr-09 5:00
harold aptroot9-Apr-09 5:00 
GeneralRe: Large memory usage. Pin
Jacob Dixon9-Apr-09 5:16
Jacob Dixon9-Apr-09 5:16 
GeneralRe: Large memory usage. Pin
Luc 6480119-Apr-09 5:39
Luc 6480119-Apr-09 5:39 
AnswerRe: Large memory usage. Pin
Anubhava Dimri8-Apr-09 19:57
Anubhava Dimri8-Apr-09 19:57 
GeneralRe: Large memory usage. Pin
Jacob Dixon9-Apr-09 3:20
Jacob Dixon9-Apr-09 3:20 
GeneralRe: Large memory usage. Pin
Anubhava Dimri9-Apr-09 18:29
Anubhava Dimri9-Apr-09 18:29 
QuestionSelectedIndexChanged problem regarding combobox and data grid Pin
dave18168-Apr-09 14:40
dave18168-Apr-09 14:40 
AnswerRe: SelectedIndexChanged problem regarding combobox and data grid Pin
Christian Graus8-Apr-09 14:42
protectorChristian Graus8-Apr-09 14:42 
GeneralRe: SelectedIndexChanged problem regarding combobox and data grid Pin
a.hamidy8-Apr-09 18:24
a.hamidy8-Apr-09 18:24 
AnswerRe: SelectedIndexChanged problem regarding combobox and data grid Pin
dave18169-Apr-09 5:11
dave18169-Apr-09 5:11 
GeneralRe: SelectedIndexChanged problem regarding combobox and data grid Pin
dave181611-Apr-09 5:14
dave181611-Apr-09 5:14 
QuestionInstance Failure Pin
CodingYoshi8-Apr-09 11:36
CodingYoshi8-Apr-09 11:36 
AnswerRe: Instance Failure Pin
Luc Pattyn8-Apr-09 11:43
sitebuilderLuc Pattyn8-Apr-09 11: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.