Click here to Skip to main content
15,885,366 members
Home / Discussions / C#
   

C#

 
AnswerRe: How instantly free up the memory for List<T> & DataSet Pin
OriginalGriff11-Apr-19 20:11
mveOriginalGriff11-Apr-19 20:11 
GeneralRe: How instantly free up the memory for List<T> & DataSet Pin
Mou_kol14-Apr-19 1:33
Mou_kol14-Apr-19 1:33 
GeneralRe: How instantly free up the memory for List<T> & DataSet Pin
OriginalGriff14-Apr-19 1:41
mveOriginalGriff14-Apr-19 1:41 
AnswerRe: How instantly free up the memory for List<T> & DataSet Pin
#realJSOP12-Apr-19 3:16
mve#realJSOP12-Apr-19 3:16 
GeneralRe: How instantly free up the memory for List<T> & DataSet Pin
Mou_kol14-Apr-19 1:36
Mou_kol14-Apr-19 1:36 
GeneralRe: How instantly free up the memory for List<T> & DataSet Pin
#realJSOP16-Apr-19 1:40
mve#realJSOP16-Apr-19 1:40 
AnswerRe: How instantly free up the memory for List<T> & DataSet Pin
jschell13-Apr-19 6:35
jschell13-Apr-19 6:35 
AnswerRe: How instantly free up the memory for List<T> & DataSet Pin
Dave Kreskowiak14-Apr-19 4:48
mveDave Kreskowiak14-Apr-19 4:48 
What nobody has asked or said anything about is "What are you using to determine if memory is being freed?"

If you're looking in Task Manager to see how much memory your app is using, DO NOT DO THAT! Task Manager is lying to you. It's showing you how much memory is RESERVED for your app, not how much it's actually using.

When you start a .NET app, the .NET Common Language Runtime (CLR) gets a block of memory from Windows and makes that block the "managed heap". The code for you app is loaded and every object your app creates is allocated using memory from the managed heap. When your app is freeing objects up, the memory is returned to the managed heap, NOT to Windows. If the CLR needs more memory for your app, its asks Windows for another block of memory. If Windows needs more memory, it can ask the CLR to return any free memory its can spare, which the CLR will happily return.

Task Manager is showing you the memory the CLR is holding onto, not how much your app is actually using. If you want to see how much your app is using, you have to use PerfMon and the .NET Memory counters.

QuestionWhat List TrimExcess() does and when to use it Pin
Mou_kol11-Apr-19 9:40
Mou_kol11-Apr-19 9:40 
AnswerRe: What List TrimExcess() does and when to use it Pin
Mycroft Holmes11-Apr-19 12:00
professionalMycroft Holmes11-Apr-19 12:00 
QuestionHow do I apply the Settings.settings values at design time? Pin
Ayub Kokabi11-Apr-19 0:38
Ayub Kokabi11-Apr-19 0:38 
AnswerRe: How do I apply the Settings.settings values at design time? Pin
Ralf Meier11-Apr-19 1:02
mveRalf Meier11-Apr-19 1:02 
GeneralRe: How do I apply the Settings.settings values at design time? Pin
Ayub Kokabi11-Apr-19 1:48
Ayub Kokabi11-Apr-19 1:48 
AnswerRe: How do I apply the Settings.settings values at design time? Pin
OriginalGriff11-Apr-19 2:28
mveOriginalGriff11-Apr-19 2:28 
GeneralRe: How do I apply the Settings.settings values at design time? Pin
Ayub Kokabi11-Apr-19 3:22
Ayub Kokabi11-Apr-19 3:22 
Questionnon intersecting circles Pin
Member 1422403810-Apr-19 3:54
Member 1422403810-Apr-19 3:54 
AnswerRe: non intersecting circles Pin
OriginalGriff10-Apr-19 3:55
mveOriginalGriff10-Apr-19 3:55 
AnswerRe: non intersecting circles Pin
Dave Kreskowiak10-Apr-19 5:16
mveDave Kreskowiak10-Apr-19 5:16 
AnswerRe: non intersecting circles Pin
Gerry Schmitz10-Apr-19 6:46
mveGerry Schmitz10-Apr-19 6:46 
AnswerRe: non intersecting circles Pin
Luc Pattyn10-Apr-19 9:58
sitebuilderLuc Pattyn10-Apr-19 9:58 
Questioncan't catch task exception with C# Pin
Member 142229339-Apr-19 16:08
Member 142229339-Apr-19 16:08 
AnswerRe: can't catch task exception with C# Pin
Member 142229339-Apr-19 18:07
Member 142229339-Apr-19 18:07 
AnswerRe: can't catch task exception with C# Pin
OriginalGriff9-Apr-19 20:05
mveOriginalGriff9-Apr-19 20:05 
AnswerRe: can't catch task exception with C# Pin
Nathan Minier10-Apr-19 2:13
professionalNathan Minier10-Apr-19 2:13 
AnswerRe: can't catch task exception with C# Pin
Richard Deeming15-Apr-19 8:11
mveRichard Deeming15-Apr-19 8:11 

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.