Click here to Skip to main content
15,889,281 members
Home / Discussions / C#
   

C#

 
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
mveRichard MacCutchan12-Apr-19 6:08 
AnswerRe: Talk Over Mic To Remote PCs Pin
jschell13-Apr-19 6:21
jschell13-Apr-19 6:21 
QuestionHow instantly free up the memory for List<T> & DataSet Pin
Mou_kol11-Apr-19 9:42
Mou_kol11-Apr-19 9:42 
AnswerRe: How instantly free up the memory for List<T> & DataSet Pin
Luc Pattyn11-Apr-19 11:56
sitebuilderLuc Pattyn11-Apr-19 11:56 
Hi,

1.
one seldom needs to worry about memory management when using C# or other .NET programming languages. Do you have positive proof there is a memory problem? Does your app use gigabytes of data (assuming a PC with several GB of physical memory)?

2.
A List<T> basically is an array containing references (pointers) to objects of type T. The memory taken by the list itself therefore is only 8 bytes multiplied by its capacity, which automatically is a power of two, and larger than the maximum number of items your list ever held, unless you explicitly reduce its size by calling TrimExcess() or setting Capacity.

3. Normally the objects themselves take much more memory than the list that holds references to them.

4.
If you think you need to worry about the memory taken by the list, make sure your listed items are referenced only by said list; if not, these objects will stay alive and hence occupy memory.

5.
Calling GC.Collect() is to be avoided, it can severely reduce performance as it scans your entire object world trying to locate dying objects. And there seldom is a need, GC collection will happen automatically when .NET feels a need to free some memory.

6.
The one thing you should do (and probably already are doing) is disposing of objects that offer a Dispose() method.

Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum

GeneralRe: How instantly free up the memory for List<T> & DataSet Pin
Mou_kol14-Apr-19 1:29
Mou_kol14-Apr-19 1:29 
GeneralRe: How instantly free up the memory for List<T> & DataSet Pin
Luc Pattyn14-Apr-19 2:25
sitebuilderLuc 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
josda100011-Apr-19 15:38 
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 
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 

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.