From Thursday, May 23rd (05:00 PM CDT) through Friday, April 24th (1:30 AM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is this memory leak in XML?

Solved!
Go to solution

Hello,

 

I don't know if I'm doing something wrong, but it looks like when a node is replaced there some memory/reference is not released. I looked in to DETT, but no reference leaks, so does it mean it's a problem in xml dll that LV uses?

 

In my target application I have to create xml reports in short time, because some content of the xml is the same for all of the reports I'm replacing only modified part of the xml and keeping only xml document reference open for whole time.

 

here's screen from the performance monitor, it is also clearly visible in task manager.

petrz_2-1654862500450.png

 

 

 

Attached simple example of what I'm trying to do (LV18).

0 Kudos
Message 1 of 5
(1,461 Views)

I had a project that used XML a few years ago. After a lot of hair pulling I ended up rolling my own XML VIs. I had a somewhat similar issue in that the built in LabVIEW XML implementation destroyed my memory. I had a ~20MB XML file in which there were ~1M data points with timestamp tags (don't use XML to store data). It would crash the computer trying to open all the data points and keeping the references in memory. I tried many things to get it to release the memory as it was traversing the file but it was no use, it really wanted to keep all the references in memory (even if closed) until the file was closed. 

 

I'm not sure if they fixed that but it looks like they did not.

 

Out of curiosity, does the memory get released when the VI finished execution? 

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 2 of 5
(1,426 Views)
Solution
Accepted by topic author petrz

I don't know if t's a memory leak or what, but I do know it's super-slow and inefficient compared to third party implementations.  (See my comment here.)

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 5
(1,417 Views)

For many reasons we long ago gave up on LabVIEW's built in XML interpreter.

 

Despite it being not updated for 16+ years I still use LabXML and it works great.

Message 4 of 5
(1,413 Views)

Yes, the memory is released when the xml document reference is closed. Look like they didn't fixed, same problem in LV2022. I guess the problem is in the Xerces library itself.

0 Kudos
Message 5 of 5
(1,361 Views)