Re: Is there memory leak in mex programming?
- From: "sutono " <craftindo.nospam@xxxxxxxxx>
- Date: Wed, 12 Dec 2007 06:30:49 +0000 (UTC)
Does anyone ever compile m code into a c++ shared library?
It works with my application. However, it can only run for
certain time, and at the end matlab runs out of memory.
the function is coded following example in
http://www.mathworks.com/support/solutions/data/1-
2Q3TJ5.html?solution=1-2Q3TJ5
Unlike the example mentioned above, it only loop 1x. My
application is video application thus, it loops forever.
So, at the end this problem appears.
Do i have to destroy the memory / matlab memory created in
each loop?
thanks
"Jerry " <mricad@xxxxxxxxxxxxxxxxxxxxx> wrote in message
<fio3g9$olr$1@xxxxxxxxxxxxxxxxxx>...
I don't know how Matlab handle this. Here is my (probablyis
too naive) question:
suppose you have the following in your mexfunction:
plhs(1)=mxCreateDoubleMatrix(10,1,zeroflag);
and in Matlab, you call the compiled mex function
(mymex.mexa64) like the following:
a=zeros(10,4)
for i=1:4
a(:,i)=mymex(...)
end
Basically, you created a 10x1 vector (let's call it a
virtual variable) and assign value to it. Then this value
assigned to "a" in Matlab. Then what happened to thememory
assigned to this virtual variable? will Matlab handle this
for you or the memory is lost?
Thanks!
.
- Prev by Date: Re: guidance
- Next by Date: matlab-time setting
- Previous by thread: C Shared library - matlab compiler
- Next by thread: matlab-time setting
- Index(es):
Relevant Pages
|