Click here to Skip to main content
15,896,154 members
Home / Discussions / C#
   

C#

 
GeneralRe: Hide form at startup Pin
Nader Elshehabi28-Dec-06 11:53
Nader Elshehabi28-Dec-06 11:53 
GeneralRe: Hide form at startup Pin
Mike Hankey28-Dec-06 12:07
mveMike Hankey28-Dec-06 12:07 
AnswerRe: Hide form at startup Pin
dsl/fahk28-Dec-06 11:52
dsl/fahk28-Dec-06 11:52 
QuestionHow to free up memory Pin
T.Willey28-Dec-06 9:45
T.Willey28-Dec-06 9:45 
AnswerRe: How to free up memory Pin
Nader Elshehabi28-Dec-06 10:52
Nader Elshehabi28-Dec-06 10:52 
GeneralRe: How to free up memory Pin
T.Willey28-Dec-06 10:56
T.Willey28-Dec-06 10:56 
GeneralRe: How to free up memory Pin
Nader Elshehabi28-Dec-06 11:27
Nader Elshehabi28-Dec-06 11:27 
AnswerRe: How to free up memory Pin
Luc Pattyn28-Dec-06 10:59
sitebuilderLuc Pattyn28-Dec-06 10:59 
In .NET you typically dont have to worry continuously about memory consumption;
objects that are in use normally stay alive, and objects that are not needed anymore,
although not deleted immediately (as would be the case with unmanaged C++ destructors),
get discarded when the garbage collector sees fit.

Also 30KB is a really small amount on most of todays systems.

It still pays off to keep memory consumption in mind when performance is important,
so one should avoid making an excessive number of objects.

I see no problems with your application; there are some strings (as in all apps),
and the FileInfo and DirectoryInfo arrays go out of scope pretty soon, so they
are collectable.

If you want to save memory, you can:
- empty collections (e.g. ListView.Clear)
- set unneeded object references to null (so they become collectible even before
they go out of scope).
Both of these of course only if your program logic allows it.

As a last resort, you could invoke the garbage collector explicitly, but in
general, this is not a good thing to do. Normally just let it do it's thing...

Smile | :)


Luc Pattyn

GeneralRe: How to free up memory Pin
T.Willey28-Dec-06 11:38
T.Willey28-Dec-06 11:38 
AnswerRe: How to free up memory Pin
Vikram kshatriya28-Dec-06 18:11
Vikram kshatriya28-Dec-06 18:11 
QuestionListView Control Pin
Civic0628-Dec-06 8:28
Civic0628-Dec-06 8:28 
AnswerRe: ListView Control Pin
Luc Pattyn28-Dec-06 8:37
sitebuilderLuc Pattyn28-Dec-06 8:37 
GeneralRe: ListView Control Pin
Civic0628-Dec-06 8:54
Civic0628-Dec-06 8:54 
QuestionHide report viewer dialog Pin
gus_br28-Dec-06 7:39
gus_br28-Dec-06 7:39 
QuestionInsert data automatically in C# Pin
TuanNH8528-Dec-06 5:45
TuanNH8528-Dec-06 5:45 
AnswerRe: Insert data automatically in C# Pin
ednrgc28-Dec-06 6:20
ednrgc28-Dec-06 6:20 
AnswerRe: Insert data automatically in C# Pin
Nader Elshehabi28-Dec-06 7:15
Nader Elshehabi28-Dec-06 7:15 
AnswerRe: Insert data automatically in C# Pin
Eric Georgiades29-Dec-06 9:26
Eric Georgiades29-Dec-06 9:26 
GeneralRe: Insert data automatically in C# Pin
TuanNH8530-Dec-06 2:46
TuanNH8530-Dec-06 2:46 
Questionpabx connected to PCU Pin
Cool_0728-Dec-06 2:37
Cool_0728-Dec-06 2:37 
AnswerRe: pabx connected to PCU Pin
Dave Kreskowiak28-Dec-06 3:43
mveDave Kreskowiak28-Dec-06 3:43 
QuestionWhere can I get the LCS API Pin
rockyl28-Dec-06 2:16
rockyl28-Dec-06 2:16 
AnswerRe: Where can I get the LCS API Pin
Dave Kreskowiak28-Dec-06 3:42
mveDave Kreskowiak28-Dec-06 3:42 
QuestionHelp me Pls. Critical Problem! Pin
TuanNH8528-Dec-06 1:19
TuanNH8528-Dec-06 1:19 
AnswerRe: Help me Pls. Critical Problem! Pin
Eduard Keilholz28-Dec-06 1:25
Eduard Keilholz28-Dec-06 1:25 

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.