How I clear the memory of a GUI without closing the windows?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I'm doing a CNC simulator with GUIDE, but after running the simulation, the program remains with a high consumption of RAM, only when it closes and reopens the memory starts to go down again
0 Kommentare
Antworten (1)
Jan
am 14 Dez. 2017
It depends on where the memory is consumed. Your current question does not contain any information which would allow to estimate, where how much memory is used. You do not even clarify what "used" means - how do you determine this?
Maybe you store huge data arrays in the ApplicationData (see guidata) or accumulate a lot of graphic elements in the figure, instead of updating the existing ones. Without seeing the code, it is impossible to guess the details.
2 Kommentare
Jan
am 14 Dez. 2017
@bayran arrieta: Please take the time to read you question and the comment again. Imagine that you do not know anything about what you are doing (as me). Then you might see, that your explanation do not clear any detail: The video does not show, what the program does internally, e.g. where which kind of objects are stored. It does not clear, how you measure the "memory consumption" - but remember that there is no unique or general definition what "consuming memory" exactly means. An application can release memory, which is not immediately usable by other applications - so is this still "consumed" or not?
So please restart this question from scratch: What exactly is your problem? Where are the objects collected, which use the memory? How do you determine the "memory consumption"? How do you try to clear them and why is closing the GUI and reopening it no valid solution already?
In many cases creating a lot of graphic objects is a bad choice, but modifying the XData, YData, ZData of an existing object is much more efficient.
Ask your question such, that the readers get enough information to write an answer. Currently it is not possible to suggest a way to clear the memory, because you do not show us, where it is used.
Siehe auch
Kategorien
Mehr zu Specifying Target for Graphics Output finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!