Profiling memory use in Matlab

The post on http://undocumentedmatlab.com/blog/undocumented-profiler-options/ describes an undocumented option of the Matlab profiler that allows for measuring memory bottlenecks.

In short, you switch it on with


profile -memory on;
profile('-memory','on'); % alternative

2 thoughts on “Profiling memory use in Matlab

  1. Robert

    % MEMPROFILE ON starts the profiler and clears previously recorded
    % profile statistics.
    %
    % MEMPROFILE OFF stops the profiler.
    %
    % MEMPROFILE RESUME restarts the profiler without clearing
    % previously recorded memory statistics.
    %
    % MEMPROFILE CLEAR clears all recorded profile statistics.
    %
    % STATS = MEMPROFILE(‘INFO’) returns a structure containing the
    % current profiler statistics.

    Reply

Leave a Reply to Robert Cancel reply

Your email address will not be published. Required fields are marked *