LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

memory leak in table control

I'm seeing a memory leak in the table control when I use the SortTableCells() function.  Each time I call the function my memory footprint increases a little.  My application either adds new data to a table, or updates it's existing data every 3 seconds or so.  Instead of having to manually determine the correct location for my new data, I simply add it to the end of the table, and sort it.  Needless to say, the gradual memory increase isn't ideal...I find it crashes my Windows 2000 box after 3 hours or so....
 
I've put together a small project to demonstrate the problem I'm seeing.  It simply populates a table, and sorts it every second (without changing any of the data).  I can watch the memory footprint grow every second in the windows task manager.
 
Would someone else like to verify that this is happening with them?  I've tested it under CVI 8.0 and 7.1 (albeit on the same computer, so they may be using the same control).
0 Kudos
Message 1 of 3
(3,086 Views)

I tested this table project briefly(less than 5 minutes) under CVI 7.0 and I did not see the memory leak described when monitoring my Task Manager.  I changed the timer to 0.25 S and memory remained stable.  Have another suspected piece of code?

 

robskii

0 Kudos
Message 2 of 3
(3,076 Views)
I ran your test and confirmed that a memory leak does in fact exist. This was a bug that was introduced in 8.0. (When you ran your test with CVI 7.1 it was still using the CVI 8.0 run-time engine, if you do have both versions installed in the same computer).

The leak happens inside SortTableCells. It leaks 8 bytes for each cell in the sort range. Unfortunately, I can't think of any workaround that you can do to avoid the leak.

The fix to this bug will be included in a patch that will be released in 2-3 months.

Luis
NI
0 Kudos
Message 3 of 3
(3,053 Views)