A deployed Matlab application that uses significantly more memory than Matlab scripts

I tested the standalone application that we developed in Matlab when I noticed that its memory usage, according to the Windows task manager, peaked several times above 16 GB. I decided to start the Matlab profiler using profile -memory on in the scripts behind the compiled version to see where the memory peaks occurred, using the same input. However, the highest peak memory that he discovered was 2400860.00 Kb, or about 1/4, for a function that essentially acts like a main() program.

Thus, I was wondering if people noticed huge differences in memory usage between the running compiled program Matlab and the launch of the original scripts in Matlab. I noticed that much more time has passed in Matlab, but I realized that this is due to the profiler tracking all memory allocations and freeing up memory, instead of reading and writing to the swap space on disk.

+8
memory matlab matlab-deployment matlab-compiler mcc
source share
1 answer

Make a real quick answer to this question. Yes, compiled MATLAB applications run with more overhead than MATLAB scripts.

This is because deployed MATLAB applications open a version of MATLAB that is stored in memory called MCR. MCR works with more overhead than MATLAB.

One thing I found useful in such situations is to recompile and see if it helps at all. If this is not the case, you can try to reduce memory usage by doing calculations in segments.

This may be useful for better memory usage: http://www.mathworks.com/help/matlab/matlab_prog/strategies-for-efficient-use-of-memory.html

A source:

Comment if you have questions.

+6
source share

All Articles