Click here to Skip to main content
14,298,167 members
   

C#

 
AnswerRe: Talk Over Mic To Remote PCs Pin
Richard MacCutchan11-Apr-19 20:30
protectorRichard MacCutchan11-Apr-19 20:30 
GeneralRe: Talk Over Mic To Remote PCs Pin
Kevin Marois12-Apr-19 4:34
professionalKevin Marois12-Apr-19 4:34 
GeneralRe: Talk Over Mic To Remote PCs Pin
Gerry Schmitz12-Apr-19 5:02
mveGerry Schmitz12-Apr-19 5:02 
GeneralRe: Talk Over Mic To Remote PCs Pin
#realJSOP12-Apr-19 5:11
mve#realJSOP12-Apr-19 5:11 
GeneralRe: Talk Over Mic To Remote PCs Pin
Gerry Schmitz12-Apr-19 9:18
mveGerry Schmitz12-Apr-19 9:18 
GeneralRe: Talk Over Mic To Remote PCs Pin
Richard MacCutchan12-Apr-19 6:08
protectorRichard MacCutchan12-Apr-19 6:08 
AnswerRe: Talk Over Mic To Remote PCs Pin
jschell13-Apr-19 6:21
memberjschell13-Apr-19 6:21 
QuestionHow instantly free up the memory for List<T> & DataSet Pin
Mou_kol11-Apr-19 9:42
memberMou_kol11-Apr-19 9:42 
1) in one of my routine i used many list and dataset. i populated those with high volume of data. when event used end then clear memory for list like

list1 = null and GC.Collect() in my routine but i am not sure that memory occupied by List1 is instantly clear or will be clear later. please share the knowledge.

2) in case of dataset i clear like

dataset1.Dispose()

dataset1=null

GC.Collect()


but i am not sure that memory occupied by dataset1 is instantly clear or will be clear later. please share the knowledge.

3) if i call GC.Collect() several time in my one routine does degrade the performance of my application ?

i found one link which said best option to release memory for list this way

first clear List and then call TrimExcess. is it the right one ?

i used like
list1=null & GC.Collect()


which one is best to clear memory for list instantly ?

please see my code below which works well.
private void button2_Click(object sender, EventArgs e)
        {
            var before = System.Diagnostics.Process.GetCurrentProcess().VirtualMemorySize64;

            List<string> lst1 = new List<string>();

            for (int i = 0; i <= 1000000; i++)
            {
                lst1.Add("Test Test Test Test Test Test Test Test Test Test Test Test Test Test Test ");
            }

            var after = System.Diagnostics.Process.GetCurrentProcess().VirtualMemorySize64;

            lst1.Clear();
            lst1.TrimExcess();

            var current = System.Diagnostics.Process.GetCurrentProcess().VirtualMemorySize64;
        }


please share best option to clear memory for list & dataset instantly. thanks
AnswerRe: How instantly free up the memory for List<T> & DataSet Pin
Luc Pattyn11-Apr-19 11:56
professionalLuc Pattyn11-Apr-19 11:56 
GeneralRe: How instantly free up the memory for List<T> & DataSet Pin
Mou_kol14-Apr-19 1:29
memberMou_kol14-Apr-19 1:29 
GeneralRe: How instantly free up the memory for List<T> & DataSet Pin
Luc Pattyn14-Apr-19 2:25
professionalLuc Pattyn14-Apr-19 2:25 
AnswerRe: How instantly free up the memory for List<T> & DataSet Pin
Gerry Schmitz11-Apr-19 13:43
mveGerry Schmitz11-Apr-19 13:43 
GeneralRe: How instantly free up the memory for List<T> & DataSet Pin
josda100011-Apr-19 15:38
memberjosda100011-Apr-19 15:38 
AnswerRe: How instantly free up the memory for List<T> & DataSet Pin
OriginalGriff11-Apr-19 20:11
protectorOriginalGriff11-Apr-19 20:11 
GeneralRe: How instantly free up the memory for List<T> & DataSet Pin
Mou_kol14-Apr-19 1:33
memberMou_kol14-Apr-19 1:33 
GeneralRe: How instantly free up the memory for List<T> & DataSet Pin
OriginalGriff14-Apr-19 1:41
protectorOriginalGriff14-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
memberMou_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
memberjschell13-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 
QuestionWhat List TrimExcess() does and when to use it Pin
Mou_kol11-Apr-19 9:40
memberMou_kol11-Apr-19 9:40 
AnswerRe: What List TrimExcess() does and when to use it Pin
Mycroft Holmes11-Apr-19 12:00
memberMycroft Holmes11-Apr-19 12:00 
QuestionHow do I apply the Settings.settings values at design time? Pin
Ayub Kokabi11-Apr-19 0:38
memberAyub Kokabi11-Apr-19 0:38 
AnswerRe: How do I apply the Settings.settings values at design time? Pin
Ralf Meier11-Apr-19 1:02
professionalRalf Meier11-Apr-19 1:02 

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.