Hello, Arno
The short answer to your question is that the Memory Usage shown by the Task Manager is not a good indicator of how much memory a CVI application is using.
The long answer is the following: for efficiency purposes, the CVI run-time engine manages the memory used by a CVI app. This memory includes, but is not limited to, calls to malloc. Part of this memory management involves allocating memory from the system in large chunks, then doling out blocks of this memory to the application as is needed. Eventually, in specific instances, these memory chunks are returned to the system whenever it is optimal to do so. The consequence of this, is that when you track the memory usage of your application using the Task Manager, you only see the memory tha
t CVI allocates from the operating system. Some of this memory is really "free" as far as your aplication is concerned.
What is happening with your application is that the function NewBitmap uses a large amount of memory to create a bitmap of 1000x1000 pixels. Upon exiting the function some of this memory is no longer needed and is freed (part of it remains allocated until you call DiscardBitmap). However, in the normal case CVI will not release this newly freed memory completely, and will instead use it to parcel out any future memory requirements of your application. Therefore, you don't see the memory disappear form the Task Manager. On the other hand, when you called MessagePopup, you accidentally stumbled into one of those instances where CVI returns to the OS memory that is not being used. This happens whenever any panel is discarded, including the MessagePopup panel.
In the end, the call to MessagePopup has no effect on the true memory usage of your application.
Luis Go
mes
NI