LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

XML Memory Leaks

I'm having trouble with using XML functions and memory leaks.  Even if I discard the element, or document, the handle remains, and it seems to keep increasing the amount of memory needed over time.
 
Is there any solution to this?
 
Terry Moss
0 Kudos
Message 1 of 7
(4,187 Views)
Hello TerryMoss,

Which functions are causing a memory leak and which version of CVI are you using? Could you provide us with a sample code that illustrates the problem, so we can reproduce the issue here?

Thank you and have a great day!
Shakhina P.
Applications Engineer
National Instruments

0 Kudos
Message 2 of 7
(4,177 Views)
Hi Shakhina,
 
The attached zip file has the 2 files that are causing me problems.  I've tried it with and without static variables, but it doesn't seem to make much difference. 
 
Thanks for the help,
 
Regards,
 
Terry
0 Kudos
Message 3 of 7
(4,157 Views)
I should also add, that is when I'm saving the xml file that I'm running into problems.  I call the save() function on a regular basis.  I haven't tried to narrow it down to exactly which function is causing the problem, but I don't have the problem if I don't call the save() function.
 
Terry
0 Kudos
Message 4 of 7
(4,157 Views)

I'm also running Windows 2000 Professional.

Terry

0 Kudos
Message 5 of 7
(4,142 Views)
Hi Terry,

Sorry for the late reply. Are you referring to the CVIXMLSaveDocument function for saving? By how much does the memory usage jump each time you call it? Also, how many times do you call your SaveTable and SaveChildElement functions to see the memory leak?

Using CVI 7.1 I didn't see any noticable difference in memory usage when saving or not saving the xml document. Which CVI version are you using?
Also, remember to discard the rootElem at the end of SaveTable().

Good luck and let me know if you have any updates on the issue.
Thanks and best regards,
Shakhina P.
Applications Engineer
National Instruments
0 Kudos
Message 6 of 7
(4,121 Views)
Attached is file that is representative of what is causing the problem.  I would say that it increases anywhere from 20k ~100 K each time the file is saved.  I'm not sure if its the file saving that's causing a problem, or the creation of the xml document itself.
 
Thanks,
 
Terry
P.S. I appologize for not getting back sooner, but I was out of the office due to personal reasons.
0 Kudos
Message 7 of 7
(4,062 Views)