From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM 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.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM 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.
03-26-2010 06:54 AM
Hi All,
I have simple labview code which has a memory leak.
I am creating the file path to the jpg file, and then using the Read JPEG file.vi and Draw Flatten PixMap.vi to display the image.
How can I do this without leaking memory?
In the future, I will have another application which updates the file every so often. I will use some sort of control to stop reading/writing to the file at the same time.
Please help,
James
Solved! Go to Solution.
03-26-2010 08:13 AM
03-26-2010 10:15 AM
Hi James
I just tried it here in 8.5.1 and a don't see memory leak.
I am going to guess that you may have the picture data in a shift register and feeding the previous iteration into Draw Flattened Pixmap picture input. Have a look inside Draw Flattened Pixmap. Its basically concatentating strings which may be your the leak you are seeing.
cheers
David
03-27-2010 06:27 AM - edited 03-27-2010 06:29 AM
Hi everyone - thanks for the replies.
My simple mock up of the issue looks like :
The LabVIEW.exe memory increases by 5,000k per iteration of the loop. This is concerning.
Is this to be expected?
Can it be avoided?
Should I consider another apporach?
PS I do not have the VDM.
THANKS!
James
03-27-2010 06:31 AM
Hi James,
i think the reason is, that you use a shift register. The "Draw Flattened Pixmap" functions adds the new image every iteration to the old one.
Mike
03-27-2010 06:46 AM
Thanks mike! That worked - obviously. I felt like I must have been missing using the VI.
Have a great weekend,
James
11-06-2017 09:26 AM
Thanks a lot
You recomadation working for me.
Best Regards