LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

DiscardCtrl does not seem to free memory.

In the Timer Callback of a panel.  I call DiscardCtrl on a bunch of controls in that panel and it does not
free up Windows memory.
 
7.0 CVI
 
VC++ 2005.net
 
Not using CVI IDE.
 
0 Kudos
Message 1 of 4
(3,329 Views)
Genesis,

This is expected behavior. The CVI runtime manages its own memory. For performance reasons, it has its own logic for when it requests memory from and returns memory to the system. So you cannot use the task manager as a true indication of how much memory your program is using.

You can see a more detailed explanation from a previous thread here.

Luis
0 Kudos
Message 2 of 4
(3,304 Views)

Thanks for the help.  But after I Discard the controls and I load more controls back on that panel  CVI request more memory from Windows.

 

Is that Normal?

 

Thanks!

0 Kudos
Message 3 of 4
(3,301 Views)
It depends on the set of controls that you are discarding versus the ones that you are creating. In theory, I wouldn't expect it to allocate more memory from the system if the sets are identical. And I would certainly not expect it to keep allocating memory if you enter into a cycle of creating and discarding controls. That would be a memory leak that would need to be investigated.

Is your program set up to do a quick test where you iterate through several cycles of creating and discarding controls, while monitoring the system memory usage?

Luis
0 Kudos
Message 4 of 4
(3,296 Views)