Call the team “for free” and analyze the results. It works on linux
[r,w] = unix('free | grep Mem');
stats = str2double(regexp(w, '[0-9]*', 'match'));
memsize = stats(1)/1e6;
freemem = (stats(3)+stats(end))/1e6;
Gbytes. "" , , . . , , "" - .
Linux MATLABs mxMalloc/mxCalloc, , malloc . , , . mex , , MATLAB:
rout = calloc(sizeof(Double),M*N);
pargout[0] = mxCreateNumericMatrix(0,0,mxDOUBLE_CLASS,mxREAL);
mxSetM(pargout[0], m);
mxSetN(pargout[0], n);
mxSetData(pargout[0], rout);
mexMakeMemoryPersistent(rout);
, MATLAB. - . MATLAB malloc, , .
, Windows. MATLAB. , . .