Review Memory Use of Functions in C/C++ Code
R2026bYou can use Polyspace®
Test™ to calculate how much stack memory is used by callable entities in your C/C++ code. See Memory Use.
This topic shows how to open and review the results of memory use calculation. For more information on calculating memory use, see:
Open Memory Use Results
You can open memory use results in the Polyspace Platform user interface or in the Polyspace Access™ web interface:
You can see memory use results after building and running tests in the Polyspace Platform user interface with memory profiling enabled or after calculating memory use using the
polyspace-code-profilercommand.In the Polyspace Platform user interface, once you open memory use results, the Results pane contains a Memory Profiling node. You can right-click this node and open a summary of results in the Dashboard perspective.
For more information, see Open Polyspace Results in Polyspace Platform User Interface.
You can upload memory use results to a Polyspace Access web server, and review the results in a web browser.
In the Polyspace Access web interface, you see results in the Project Explorer pane. You can select a memory use result set to open a summary of results in the Dashboard perspective.
For more information, see Upload Results to Polyspace Access.
You see the same display of memory use results in the Polyspace Platform user interface and the Polyspace Access web interface.
View Memory Use Results on Dashboard
In the Dashboard perspective, you can see a Project Overview dashboard containing an overview of all types of results, and a Memory Profiling dashboard containing more details of memory use results. By default, you see the Project Overview dashboard. Select Memory Profiling on the toolstrip to open the Memory Profiling dashboard.
The Project Overview dashboard contains a Memory Profiling section showing the metric Stack (Max). The metric value is reported in bytes.
The Memory Profiling dashboard consists of these sections:
Memory Profiling: This section shows the metric Stack (Max) that you also see on the Project Overview dashboard.

View by File: This section shows a breakdown of the memory use by file and function. In the rightmost column, the dark bands correspond to the self memory usage and the light bands correspond to the maximum stack memory usage.

For more information on memory use metrics, see
Memory Use.View by Project: In the Polyspace Access web interface, you can also see a dashboard that spans several projects by selecting a parent folder in the Project Explorer pane. To help you distinguish between results from different projects, the Memory Profiling dashboard in Polyspace Access has this additional section that shows a per-project breakdown of the test results.