Memory profiling an app designer app?
Mostra commenti meno recenti
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 Commento
Ken
il 27 Apr 2024
Risposte (1)
Tiffany
il 30 Mag 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!
Categorie
Scopri di più su Entering Commands in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!