Memory profiling an app designer app?

조회 수: 12 (최근 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 CenterFile Exchange에서 App Building에 대해 자세히 알아보기

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by