Click here to Skip to main content
15,921,463 members
Home / Discussions / Windows Forms
   

Windows Forms

 
Questionhow do i malloc in c# windowform? Pin
neodeaths11-Aug-10 9:42
neodeaths11-Aug-10 9:42 
AnswerRe: how do i malloc in c# windowform? Pin
Eddy Vluggen11-Aug-10 10:00
professionalEddy Vluggen11-Aug-10 10:00 
AnswerRe: how do i malloc in c# windowform? Pin
Luc Pattyn11-Aug-10 10:21
sitebuilderLuc Pattyn11-Aug-10 10:21 
AnswerRe: how do i malloc in c# windowform? Pin
Dave Kreskowiak11-Aug-10 13:06
mveDave Kreskowiak11-Aug-10 13:06 
AnswerRe: how do i malloc in c# windowform? Pin
johannesnestler26-Aug-10 4:01
johannesnestler26-Aug-10 4:01 
QuestionMinimize window to gain memory space??? Pin
Heinz_10-Aug-10 19:14
Heinz_10-Aug-10 19:14 
AnswerRe: Minimize window to gain memory space??? Pin
Eddy Vluggen10-Aug-10 20:40
professionalEddy Vluggen10-Aug-10 20:40 
AnswerRe: Minimize window to gain memory space??? PinPopular
Dave Kreskowiak11-Aug-10 1:33
mveDave Kreskowiak11-Aug-10 1:33 
First, stop looking at Task Manager to get your memory stats for your app. It's lying to you.

Next, I suggest reading up on .NET Memory Management and Garbage Collector to understand how it really works.

A .NET application runs in something like a virtual machine, sort of like Java does. What Task Manager is showing you is the memory that is RESERVED for the process, NOT what your app is actually using. Since the .NET CLR handles memory management for your application, it has to get memory from Windows to allocate to your application. This chunk of memory is the Managed Heap and all of your application objects are allocated from it. When your app frees an object, the memory goes back into the Managed Heap, not back to Windows. This is why your app appears to use more memory than it actually does.

The .NET CLR tries to keep this pool of memory at a resonable level, constantly watching how your app allocates objects and trying to predict when it's going to need more managed heap. It doesn't take near as much time to allocate an object in the Managed Heap than if it had to go to Windows to request more memory, add it to the heap, then allocate your object. The reverse is also true. If the CLR determines that there is an over abundance of unused Heap, it can return some of that memory back to Windows. Or, can even release as much memory as possible if Windows starts to run low and needs it back.

When you minimize the app, it's no longer in the foreground. The .NET CLR trims back the Managed Heap to something closer to what your app is actually using and returns that released memory back to Windows.

GeneralRe: Minimize window to gain memory space??? Pin
Richard Blythe11-Aug-10 4:48
Richard Blythe11-Aug-10 4:48 
GeneralRe: Minimize window to gain memory space??? Pin
Dave Kreskowiak11-Aug-10 5:47
mveDave Kreskowiak11-Aug-10 5:47 
GeneralRe: Minimize window to gain memory space??? Pin
Pete O'Hanlon13-Aug-10 21:36
mvePete O'Hanlon13-Aug-10 21:36 
GeneralRe: Minimize window to gain memory space??? Pin
Dave Kreskowiak14-Aug-10 3:19
mveDave Kreskowiak14-Aug-10 3:19 
GeneralRe: Minimize window to gain memory space??? Pin
Richard Blythe14-Aug-10 5:03
Richard Blythe14-Aug-10 5:03 
GeneralRe: Minimize window to gain memory space??? Pin
AnnieMacD11-Aug-10 11:15
AnnieMacD11-Aug-10 11:15 
GeneralRe: Minimize window to gain memory space??? [modified] Pin
Heinz_15-Aug-10 21:06
Heinz_15-Aug-10 21:06 
GeneralRe: Minimize window to gain memory space??? Pin
Dave Kreskowiak16-Aug-10 1:44
mveDave Kreskowiak16-Aug-10 1:44 
Questioncan window form manipulate keyboard and mouse movement? Pin
neodeaths9-Aug-10 6:43
neodeaths9-Aug-10 6:43 
AnswerRe: can window form manipulate keyboard and mouse movement? Pin
Luc Pattyn9-Aug-10 7:10
sitebuilderLuc Pattyn9-Aug-10 7:10 
QuestionApplication Security - Design Question Pin
imak4-Aug-10 9:09
imak4-Aug-10 9:09 
AnswerRe: Application Security - Design Question Pin
Mycroft Holmes7-Aug-10 0:50
professionalMycroft Holmes7-Aug-10 0:50 
AnswerRe: Application Security - Design Question Pin
T M Gray9-Aug-10 8:20
T M Gray9-Aug-10 8:20 
JokeRe: Application Security - Design Question Pin
johannesnestler26-Aug-10 4:13
johannesnestler26-Aug-10 4:13 
AnswerRe: Application Security - Design Question Pin
All Time Programming3-Sep-10 3:49
All Time Programming3-Sep-10 3:49 
QuestionForm with FormBorderStyle=FixedToolWindow && No close button [modified] Pin
King Balkoth2-Aug-10 12:46
King Balkoth2-Aug-10 12:46 
AnswerRe: Form with FormBorderStyle=FixedToolWindow && No close button Pin
Luc Pattyn2-Aug-10 13:03
sitebuilderLuc Pattyn2-Aug-10 13:03 

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.