LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

openG dictionary behaviour

First, apologies for posting this on the NI forum rather than LAVA, I cannot seem to access the latter at the moment. I know the authors of the package do frequent this forum so I thought it would be worth a shot.

I am using the dictionaries, from the openG packages, and I think they are great.

A question regarding their cleanup, do I have to manually clear the dictionary before destroying the reference, or is just destroying it sufficient. I ask as I use a few dictionaries in my current project, each with several thousand key-value pairs, and the operating system (winxp) seems to allocate "new" memory when I destroy the reference and re-create the dictionary (I do this periodically to reload data that could have changed).

This behaviour may just be due to memory fragmentation and garbage collection issues, but my application seems to be slowly eating up memory.

Any suggestions about the dictionary behaviour before I go off trying to find other sources of the memory leak?

Many thanks
nrp
0 Kudos
Message 1 of 4
(3,285 Views)

I haven't used the dictionary VIs, but looking at the code shows that they use OpenGOOP, which works by opening a reference to a reentrant LV2 global.

When you destroy the object, the reference is also closed, so the reentrant VI should theoretically be removed from memory at the point, but the memory is not always freed up immediately because of the way LV manages memory. I'm not sure which VI is considered the top level VI when you have a dynamic call, but that is what should determine when LabVIEW actually releases the memory to be reused by another application.

If you want, OpenG have their own forums, where you can ask the question.


___________________
Try to take over the world!
Message 2 of 4
(3,280 Views)
Thanks tst,

I sort of figured as much re the dynamic memory allocation. I knocked up a quick test VI which rapidly creates and destroys dictionaries and had a control to switch clearing on/off to see the effect of the memory allocation.

The clearing didnt seem to have much effect, and the memory just naturally jitters around, but doesnt seem to increase over the long term. What is strange is that when compiled into an exe, the memory the test application uses varies wildly (by up to 10 MB). In fact its a bit odd that the test VI uses so much memory, around 40 --> 50 MB for a relatively simple example (attached)

I actually meant to go to the openG forum, but typed LAVA into google without thinking Smiley Tongue

0 Kudos
Message 3 of 4
(3,261 Views)

I was interested to know if you ever found an answer to this quesion

Danny Thomson AshVire Ltd
0 Kudos
Message 4 of 4
(2,837 Views)