Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Dissipated memory: videoinput and start

Subject: Dissipated memory: videoinput and start

From: Louis

Date: 24 Nov, 2010 18:43:04

Message: 1 of 3

Hello,

I want to process images from a webcam, i noticed that there is some memory dissipation somewhere, can you please advise me what am i doing wrong?

Following is the simple code and the memory chart associated with it:

>> vid = videoinput('winvideo',1,'YUY2_320x240');
>>set(vid,'TriggerRepeat',Inf);
>>set(vid,'ReturnedColorSpace','ycbcr');
>>start(vid)

following is the memory commands separated within 1 minute interval.
#1: memory
Maximum possible array: 892 MB (9.357e+008 bytes) *
Memory available for all arrays: 1477 MB (1.548e+009 bytes) **
Memory used by MATLAB: 288 MB (3.024e+008 bytes)
Physical Memory (RAM): 3543 MB (3.715e+009 bytes)

#2: memory
Maximum possible array: 716 MB (7.511e+008 bytes) *
Memory available for all arrays: 1298 MB (1.361e+009 bytes) **
Memory used by MATLAB: 312 MB (3.269e+008 bytes)
Physical Memory (RAM): 3543 MB (3.715e+009 bytes)

#3: memory
Maximum possible array: 708 MB (7.427e+008 bytes) *
Memory available for all arrays: 1290 MB (1.353e+009 bytes) **
Memory used by MATLAB: 356 MB (3.737e+008 bytes)
Physical Memory (RAM): 3543 MB (3.715e+009 bytes)

#4: memory
Maximum possible array: 580 MB (6.085e+008 bytes) *
Memory available for all arrays: 1194 MB (1.252e+009 bytes) **
Memory used by MATLAB: 379 MB (3.974e+008 bytes)
Physical Memory (RAM): 3543 MB (3.715e+009 bytes)

.
.
.

>>memory
Maximum possible array: 260 MB (2.730e+008 bytes) *
Memory available for all arrays: 874 MB (9.163e+008 bytes) **
Memory used by MATLAB: 717 MB (7.516e+008 bytes)
Physical Memory (RAM): 3543 MB (3.715e+009 bytes)


i just run the code above and waited some time and gave the 'memory' command.

Please advise

Regards

Louis

Subject: Dissipated memory: videoinput and start

From: Louis

Date: 24 Nov, 2010 18:53:03

Message: 2 of 3

And after some time, i get the following message :

Error event occurred at 13:35:10 for video input object: YUY2_320x240-winvideo-1.
Unable to allocate memory for an incoming image frame. Use IMAQMEM to modify the frame memory limit.
??? Unable to allocate memory for an incoming image frame. Use IMAQMEM to modify the frame memory limit.

I tried accessing IMAQMEM but couldnt "modify the frame memory limit"

Oh if i do clear all, i dont get my memory back so i have to close and reopen matlab again.

Thank you again

Louis

Subject: Dissipated memory: videoinput and start

From: ecem

Date: 10 Jan, 2014 14:54:17

Message: 3 of 3


Louis, try using 'flushdata(vid)'

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us