LAVA 1.0 Content Posted January 15, 2008 Report Share Posted January 15, 2008 Hi there, Could some one explain little more about "Request Deallocation " this function? (Apart from whats there in the NI Help ) Can i use this in all the subvi's thats been called by the "Main" vi ? Is there any limitation for the same? Quote Link to comment
Rolf Kalbermatter Posted January 15, 2008 Report Share Posted January 15, 2008 QUOTE(guruthilak@yahoo.com @ Jan 14 2008, 01:29 AM) Hi there,Could some one explain little more about "Request Deallocation " this function? (Apart from whats there in the NI Help ) Can i use this in all the subvi's thats been called by the "Main" vi ? Is there any limitation for the same? You can but it is not a magical wand that makes your programs go faster or work better just like that. In fact it is likely it will make them much much slower. Request Deallocation tells LabVIEW to deallocate all memory that is not currently in use. And that will deallocate memory that a VI that is currently idle may just need 1ms later again to do its work so it has to allocate it again instead of being able to reuse it. Request Deallocation only makes sense when you have a VI that uses lots and lots of memory and only runs once or maybe every two weeks in the lifetime of your application. Doing a Request Deallocation right after executaion of that VI may (or may also not) improve the memory consumption of your application. Otherwise this function causes more trouble than it would solve, which is why it isn't very prominently made available. Rolf Kalbermatter Quote Link to comment
MikaelH Posted January 15, 2008 Report Share Posted January 15, 2008 Hi I have a scenario that I actually have to use this VI. It is three test cases that take on hour each to run. Every test case collects lot of measurement data first and just before they finish they calculate some results from the measurements. Since LabVIEW don’t know if this VI will be running again, it doesn’t free the allocated buffers for all my measurements. So when I get to the last test case I run out of memory. Cheers, Mikael Quote Link to comment
Ton Plomp Posted January 16, 2008 Report Share Posted January 16, 2008 QUOTE(MikaelH @ Jan 15 2008, 12:33 AM) HiI have a scenario that I actually have to use this VI. It is three test cases that take on hour each to run. Every test case collects lot of measurement data first and just before they finish they calculate some results from the measurements. Since LabVIEW don't know if this VI will be running again, it doesn't free the allocated buffers for all my measurements. So when I get to the last test case I run out of memory. Cheers, Mikael If you call the VI dynamically and close the VI reference LabVIEW will also make the memory available. Ton 1 Quote Link to comment
Rolf Kalbermatter Posted January 16, 2008 Report Share Posted January 16, 2008 QUOTE(tcplomp @ Jan 15 2008, 12:10 AM) If you call the VI dynamically and close the VI reference LabVIEW will also make the memory available.Ton That is a very good remark. As it seems to me Mikail has some sort of test application. This is in most cases the ideal application to use dynamic execution of the test steps as in some sort of plugin architecture. Also what I suspect is that he maintains the data in a front panel control/indicator or something through locals. If he would use shift registers, Request Deallocation would not have any influence since the shift register needs to maintain its data between executions. On the other hand shift registers allow programmatic clearing whenever desired. This means that for using shift registers which among other modern constructs like queues is the way to store intermediate data, Request Deallocation is getting rather useless. I feel that Request Deallocation makes no sense in 99.99% of the cases for a properly designed application. Rolf Kalbermatter Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.