Click here to Skip to main content
15,889,462 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionRequired .NET Profiler Pin
RajeshGuptha30-Jan-06 1:00
RajeshGuptha30-Jan-06 1:00 
AnswerRe: Required .NET Profiler Pin
tarasn30-Jan-06 4:48
tarasn30-Jan-06 4:48 
AnswerRe: Required .NET Profiler Pin
Robert Rohde30-Jan-06 20:24
Robert Rohde30-Jan-06 20:24 
GeneralRe: Required .NET Profiler Pin
RajeshGuptha2-Feb-06 7:58
RajeshGuptha2-Feb-06 7:58 
QuestionInstall Framework 2.0 SDK with Visual Studio 2003 Pin
nikolag29-Jan-06 21:35
nikolag29-Jan-06 21:35 
AnswerRe: Install Framework 2.0 SDK with Visual Studio 2003 Pin
Dave Kreskowiak30-Jan-06 1:32
mveDave Kreskowiak30-Jan-06 1:32 
GeneralRe: Install Framework 2.0 SDK with Visual Studio 2003 Pin
nikolag31-Jan-06 21:45
nikolag31-Jan-06 21:45 
Generalnew (?) .NET memory usage solution Pin
User 221952029-Jan-06 17:44
User 221952029-Jan-06 17:44 
hi all,

Recently I devised this bit of code (C#) that works wonders for the memory usage reported in task manager:

Process currentProcess = System.Diagnostics.Process.GetCurrentProcess();
currentProcess.MinWorkingSet = currentProcess.MinWorkingSet;

With one of my more complicated programs, this reduced the initial memory usage (measured once the form loaded completely) from 34690 KB to 8980 KB (!).

I've tried various other solutions, most of which rely on forcing a garbage collection or reducing the process' working set to the minimum working set. I found neither to be very effective. I've never seen this approach anywhere else (small wonder - who would think that setting a value to itself would make such a difference?!).

I haven't had time to research why/how this code works, but this solution changes no values and has an immediate effect (just like minimizing and restoring a .NET program does). Place it in your code after your form initializes and watch your memory usage go down!

Hope this helps someone!
GeneralRe: new (?) .NET memory usage solution Pin
leppie29-Jan-06 18:27
leppie29-Jan-06 18:27 
GeneralRe: new (?) .NET memory usage solution Pin
User 221952029-Jan-06 18:35
User 221952029-Jan-06 18:35 
GeneralRe: new (?) .NET memory usage solution Pin
Colin Angus Mackay29-Jan-06 21:21
Colin Angus Mackay29-Jan-06 21:21 
GeneralRe: new (?) .NET memory usage solution Pin
User 221952029-Jan-06 21:55
User 221952029-Jan-06 21:55 
GeneralRe: new (?) .NET memory usage solution Pin
Colin Angus Mackay29-Jan-06 21:23
Colin Angus Mackay29-Jan-06 21:23 
GeneralRe: new (?) .NET memory usage solution Pin
User 221952029-Jan-06 22:03
User 221952029-Jan-06 22:03 
GeneralRe: new (?) .NET memory usage solution Pin
Dave Kreskowiak31-Jan-06 4:47
mveDave Kreskowiak31-Jan-06 4:47 
GeneralRe: new (?) .NET memory usage solution Pin
User 221952031-Jan-06 10:44
User 221952031-Jan-06 10:44 
GeneralRe: new (?) .NET memory usage solution Pin
Dave Kreskowiak31-Jan-06 17:12
mveDave Kreskowiak31-Jan-06 17:12 
GeneralRe: new (?) .NET memory usage solution Pin
Glaxalg31-Mar-06 9:05
Glaxalg31-Mar-06 9:05 
QuestioniActiveScript & C# Pin
veeran29-Jan-06 17:01
veeran29-Jan-06 17:01 
Question.NET equivalent of CStatic? Pin
Ravi Bhavnani29-Jan-06 11:47
professionalRavi Bhavnani29-Jan-06 11:47 
AnswerRe: .NET equivalent of CStatic? Pin
leppie29-Jan-06 18:29
leppie29-Jan-06 18:29 
GeneralRe: .NET equivalent of CStatic? Pin
Ravi Bhavnani30-Jan-06 1:16
professionalRavi Bhavnani30-Jan-06 1:16 
AnswerRe: .NET equivalent of CStatic? Pin
malharone1-Feb-06 11:39
malharone1-Feb-06 11:39 
GeneralRe: .NET equivalent of CStatic? Pin
Ravi Bhavnani4-Feb-06 1:30
professionalRavi Bhavnani4-Feb-06 1:30 
QuestionC#.Net Pin
Net-Programer-and-developer29-Jan-06 6:42
Net-Programer-and-developer29-Jan-06 6:42 

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.