Is it possible for matlab to clear a mex function even when mexIsLocked is true?

4 ビュー (過去 30 日間)
Russ
Russ 2015 年 8 月 24 日
編集済み: Walter Roberson 2015 年 8 月 24 日
I'm debugging a frustrating memory issue here https://github.com/RobotLocomotion/drake/pull/1274, and am seeing what I thought to be illegal behavior. Here is my code stub:
void onExit(void) {
cout << "paging new.cpp out of memory" << endl << "in exit function: ";
if (mexIsLocked())
cout << "mex file is locked" << endl;
else
cout << "mex file is unlocked" << endl;
}
void mexFunction( int nlhs, mxArray *plhs[],int nrhs, const mxArray *prhs[] ) {
mexAtExit(&onExit);
...
and the output? you guessed it. in the middle of my execution I get:
paging new.cpp out of memory
in exit function: mex file is locked
are there any cases where matlab will still clear a mex file from memory despite it being locked?

回答 (1 件)

James Tursa
James Tursa 2015 年 8 月 24 日
編集済み: James Tursa 2015 年 8 月 24 日
Can you use the inmem function to verify that the mex routine actually got cleared even though it was locked? Do you have any code that manually calls the onExit function?
  1 件のコメント
Russ
Russ 2015 年 8 月 24 日
I confirm that there is no code which calls the onExit function. This function was added only for debugging -- it was the final test I added before posting.
I will see if I can confirm via inmem.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by