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.
02-15-2021 12:10 PM
Hello Everyone ,
I would like to use request deallocation function in my software .
My code is a QMH in which one of the states is an imaging state . I have multiple big arrays passed by data references in this loop . There are some subVI's that are used for array manipulation and I suspect they might be creating copies that isn't released until the application is stopped. There are also some IMAQ vi's placed in subVI's that are running preallocated reentrant .
I am facing out of memory errors sometimes and for this I am thinking of placing the request deallocation function after the loop calling the subVI's is stopped . I cannot stop the top level VI and it should keep on running . I cannot post the code since it is confidential but I can provide a simple mock code that can be found attached .
Also , what is the ideal way to get rid of the array from the ram ? I read the data reference of the array using IPE and wire the array to a reshape array with 0 as rows and columns then delete the reference, is this ideal . Anybody's got a better suggestion ?
And lastly , if I were to delete a Data reference of an Array and extract the data from the delete reference function , what is happening here ? is it just deleting the reference or the array in memory space ? If I don't extract it will it just rest in memory and not be released until the calling VI is closed ?
An important point to consider would be that I am using NI RT Linux target .
Looking forward to your response and critiques ,
Best Regards,
SP_TT
Solved! Go to Solution.
02-15-2021 02:33 PM
@SP_TT wrote:Also , what is the ideal way to get rid of the array from the ram ? I read the data reference of the array using IPE and wire the array to a reshape array with 0 as rows and columns then delete the reference, is this ideal . Anybody's got a better suggestion ?
What you are doing should release the memory; the deallocation should not be necessary. I do the same thing, on Windows though, and see the memory released. No deallocation necessary.
Your issues are probably in your math and subVIs. Since you cannot show them, I suggest you play "whack the dots." Turn on the profile tool to see buffer allocations, if you have dots on both sides of the IPE structure, then you have copies. Try to eliminate as much as possible.
mcduff
02-16-2021 02:45 AM
Hello Mcduff ,
Thank you for your inputs . I shall try to check for allocated buffers .
In theory shouldn't request deallocation function help clear these buffers after loop execution is completed ? it might be that these allocated buffers aren't getting reused by LabVIEW and it might be piling up the memory ?
02-16-2021 08:53 AM
@SP_TT wrote:
Hello Mcduff ,
Thank you for your inputs . I shall try to check for allocated buffers .
In theory shouldn't request deallocation function help clear these buffers after loop execution is completed ? it might be that these allocated buffers aren't getting reused by LabVIEW and it might be piling up the memory ?
You can try, but in my experience request deallocation either doesn't work they way I want it to work or the program has some weird hiccups because of deallocation.
The following thread is old, but it shows you what to look for when you try to whack the dots.
https://forums.ni.com/t5/LabVIEW/LabVIEW-2015-Buffer-Allocation-Bug/td-p/3300392
mcduff
02-16-2021 10:54 AM
Great , Thank you for your helpful suggestions . Have a nice day !