Memory profiling an app designer app?

12 vues (au cours des 30 derniers jours)
Ken
Ken le 23 Avr 2024
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 commentaire
Ken
Ken le 27 Avr 2024
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.

Connectez-vous pour commenter.

Réponses (1)

Tiffany
Tiffany le 30 Mai 2024
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!

Catégories

En savoir plus sur App Building dans Help Center et File Exchange

Produits


Version

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by