Jump to content

Request Deallocation


Recommended Posts

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

Link to comment

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

Link to comment

QUOTE(MikaelH @ Jan 15 2008, 12:33 AM)

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

If you call the VI dynamically and close the VI reference LabVIEW will also make the memory available.

Ton

  • Like 1
Link to comment

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

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.