octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Access of a nested structure memory leak in mex function


From: Evangelos Rozos
Subject: Re: Access of a nested structure memory leak in mex function
Date: Wed, 10 Jul 2019 12:42:24 +0300

Yes, I will do that.

On Mon, 8 Jul 2019 at 18:35, Rik <address@hidden> wrote:
On 07/04/2019 09:01 AM, address@hidden wrote:
Subject:
Access of a nested structure memory leak in mex function
From:
Evangelos Rozos <address@hidden>
Date:
07/04/2019 03:59 AM
To:
address@hidden
List-Post:
<mailto:address@hidden>
Content-Transfer-Encoding:
8bit
Precedence:
list
MIME-Version:
1.0
Message-ID:
<address@hidden>
Content-Type:
text/plain; charset=utf-8; format=flowed
Message:
1

The access of a nested structure passed to a mex function seems to create memory leak.

Example code:

 mxArray* pmx1=NULL;
 mxArray* pmxid=NULL;
 pmx1= mxGetField(prhs[0], 0, "InsDmd");
 pmxid= mxGetField(pmx1, 0, "id");        // <-- memory leak stops when commenting this out


This problem has been witnessed in Octave 5.1.0/win64 and Octave 4.2.2/Linux (I believe exists in every platform and recent Octave version). The same code does not create leak when compiled in MATLAB.

Apparently, the indicated line code above does not create directly the leak, but somehow confuses the memory management. The leak is noticeable only after numerous calls of the mex function (7.6 MB/100000 calls).

Evangelos Rozos

Could you file this as a bug report at bugs.octave.org?  It is liable to get lost on the mailing list.

When you do file a report, please include the Octave m-file code that is associated with the mex C code so that the issue can be reproduced.

Thanks,
Rik


reply via email to

[Prev in Thread] Current Thread [Next in Thread]