Force a garbage collection
MuPAD® notebooks will be removed in a future release. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
forceGarbageCollection() forces a garbage
collection to be performed. This function serves a highly technical
purpose. Usually, there should be no need for a user to call this
Each time the interactive level is reached, the garbage collection
routine is called. A heuristic algorithmn decides whether a garbage
collection is really performed. After a call to
a garbage collection will be forced on the next call of the garbage
forceGarbageCollection does not cause an
immediate garbage collection; it is only executed on returning to
the interactive level. Therefore, it cannot be used in procedures
to release memory during a longer computation.
When the interactive level is reached, a garbage collection is performed:
Void object of type