User`s guide

Managing Memory Usage
Managing Memory Usage
In this section.. .
“Memory Usage” on page 5-35
“Monitoring Memo ry Usage” on page 5-35
“Modifying the Frame Memory Limit” on page 5-36
“Freeing Memory” on page 5-37
Memory Usage
Thefirsttimeitneedstoallocatememorytostoreanimageframe,thetoolbox
determines the total amount of memory it has available to store acquired
image frames. By default, the toolbox sets this value, called the frame memory
limit, to equal all the physical memory that is available when the toolbox
is first accessed.
Image data can require a lot of memory. For example, even a relatively small
(96-by-128) 24-bit color im ag e require s almos t 37 K bytes for each fra m e.
whos
Name Size Bytes Class
rgb_image 96x12 8x3 36864 uint8 array
Monitoring Memor y Usage
The toolbox includes a utility function, called imaqmem,thatprovides
information about the toolbox’s current memory usage.
The
imaqmem function returns a structure that contains several memory
usage statistics including the total amount of physical memory available, the
amount of physical memory currently in use, and a value, called the memory
load, that characterizes the current memory usage.
To illustrate, this example calls
imaqmem and then uses the frame memory
limit and the current fram e mem ory usage statistics to calculate how much
memory is left for image frame storage.
5-35