Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I set the heap size on the compact vision system?

Hi, is there a way of changing the amount of RAM that is allocated (out of the total 128MB) as heap space on the Compact Vision system?
0 Kudos
Message 1 of 6
(4,566 Views)

AnthonV,

    Could you explain why you woud like to change the heap size?  Also, I'm assuming you mean the heap set aside for the operating system, is that right?

-Allison S.
Calibration Services
Product Support Engineer
0 Kudos
Message 2 of 6
(4,528 Views)

Hi Allison, I want to increase the heap size as I am worried that I might run out of memory when loading many images into the heap.  So I am referring to the heap allocated to the application's data.  If this resizes automatically as required then this is not an issue and I do not have to set it at all.

I'm looking at the RT Get Memory Stats.vi output and noticed that the 'Heap Contiguous' is getting close to zero - assuming that IMAQ wants a contiguous block for every image's data this is soon going to be a problem for me.  Have a look at the attached image - it shows the output from RT Get Memory Stats.vi.  Currently it shows 7MB contiguous heap available, but another few 2megapixel images loaded will reduce this to zero.

It is also very possible that I misunderstand the memory allocation process in the RT targets so let me know if this is the case.

Thanks

Anthon

0 Kudos
Message 3 of 6
(4,486 Views)
Hi Anthon,

There isn't a way to change the size of the heap.  But how are you creating your buffers for your images?  Are you are using a Ring buffer?  If you keep alocating memory for images then eventually you will run out of space.  If you are running out of memory you can attach an external hard drive and write images to the file.   Also what CVS are you using? 

Have a great day,
GG
0 Kudos
Message 4 of 6
(4,399 Views)

Unfortunately these aren't images that can be saved to disk.  Some are created on-line from captured images and some are read from flash at startup - they are required for the image processing that is done on the device. 

What I'm asking if one has control over the allocation of the RAM to code space and heap/stack space as on a normal system.  In some case you might have a large vi that requires more code space, but in others there might be a need for more dynamically allocated heap.

I'm using the cheapest CVS at the moment.

0 Kudos
Message 5 of 6
(4,361 Views)
Hi,

Sorry there isn't a way that you can set the amount of memory for the heap.  The memory will be automatically alocated.  You'll have to make sure you are handeling your images correctly so that you don't run out of memory.  So if you are reusing the same spots in memory allocated for images then you shouldn't run out of space. 

Regards,
GG
0 Kudos
Message 6 of 6
(4,309 Views)