Memory profiling an app designer app?

10 ビュー (過去 30 日間)
Ken
Ken 2024 年 4 月 23 日
回答済み: Tiffany 2024 年 5 月 30 日
My app designer app has a memory leak. I don't understand how this would happen, because I have only a finite number of array variables, and I assume that when the data in one of these is replaced, the old data are flushed and garbage collected. Right?
But anyway, I need to do memory profiling and see when the upticks in usage are happening. The documentation I can find mostly refers to profiling for speed, and profiling small chunks of code. How do I profile for memory, and watch the whole app? (Or sprinkle memory usage checkpoints throughout my code?) And an old third-party post I see a reference to a built in command memory, but it seems to no longer exist, it gets an error "Function MEMORY is not available on this platform." (I'm using a Mac.) Is there a new command that replaces it?
  1 件のコメント
Ken
Ken 2024 年 4 月 27 日
A call to tech support got me the information that they fixed a known memory leak bug as of R2023b Update 6. R2024a is clean.
So I didn't learn how to do memory profiling, but it probably wouldn't have helped since the bug was beyond my control anyway.

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

回答 (1 件)

Tiffany
Tiffany 2024 年 5 月 30 日
Hi Ken,
I'm happy to hear that you were able to pinpoint the issue through tech support. Just in case you're still interested in memory profiling your App Designer application, you can use MATLAB profiler. To do so:
1. Begin the Profiler by entering the following in the MATLAB command window:
>> profile on -memory
2. Run and interact with your app.
3. Stop the Profiler:
>> profile off
4. View the Profile Summary, which should include information about allocated memory, freed memory, peak memory and so forth:
>> profile viewer
For more information on profiling your code to improve performance, please view:
Additionally, to learn more about how MATLAB allocates memory, please view:
I hope the above helps!

カテゴリ

Help Center および File ExchangeApp Building についてさらに検索

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by