dle and data. As long as
data has an associated handle, the JVM considers it valid and
will not clean it up.
However, when you call the clear function in MATLAB, all handles are
destroyed, and the data associated is now invalid. This means that
the JAVA engine can free up that data (garbage collection), but does
not mean that it will clean it up at that moment.
Calling the PACK command encourages JAVA to run the garbage collector
and de-fragment the memory. But it does not force it to (This is part
of the JAV