AnsweredAssumed Answered

Memory Hoard

Question asked by VRFuser on Sep 1, 1997
I got this from the latest newsletter.  Does VEE release the hoarded
memory when the program is exited??

Jeffrey S. Pahl                      email:
Test Engineer                        Addr:   PO Box 7700
Space Systems Group                      Norcross, GA 30091-7700
EMS Technologies, Inc.        Phone:  (770) 263-9200 x4277
An Electromagnetic Sciences Company         
"If at first you don't succeed, get a bigger hammer"


* On current versions of VEE, you can bring out a pin on the Direct I/O
object to allow programmatically setting the address of a instrument.

Unfortunately ... every time you do this, VEE allocates a little more
memory. This is a memory "hoard", not a memory "leak". A leak is where a
program allocates memory and then misplaces it; a hoard is where a
program continues to keep allocating memory it doesn't need. A hoard is
harder to track down because, as far as the operating system is
concerned, the program is acting legally.

You can also bring out a pin on Direct I/O to allow you to specify an
I/O configuration name ... it has the same problem as the address pin.

There is a workaround, though it has a limitation. We have created a
special (very simple) classic VEE driver that uses a different mechanism
to allow changing the address through a data pin (not a control pin,
which is how the default -- buggy -- mechanism works). Create a device
name for this driver, load the driver in your program, and when you
change the address for the driver, all Direct I/O objects associated
with that device name change their address as well.

However, this means that you can only change the addresses for Direct
I/O. Since you have to use this custom driver for that device name, you
cannot use the driver designed for that instrument. We should have the
driver on the website presently ... in the meantime, contact us for the
materials and we will email them to you.