Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: OO matlab - deleting objects
Replies: 6   Last Post: Feb 27, 2013 5:20 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Andrew Groth

Posts: 2
Registered: 4/6/12
Re: OO matlab - deleting objects
Posted: Feb 27, 2013 3:49 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

> No.
>
> When a non-handle object is no longer accessible, it and all its properties
> are cleared from memory just like normal variables when they go out of scope
> (like when the function whose workspace they are in exits.) If that
> non-handle object contains another object in one of its properties, then if
> that other object is a non-handle object it too will be cleared from memory;
> if it is a handle object, its delete method (if any) will be called, then it
> will be cleared from memory. Thus in neither of those situations do you,
> the user, need to do anything special.
>
> When a handle object is no longer accessible, the same procedure as I
> described above happens, except that its delete method is called before it
> is cleared from memory. The reason the text above calls out non-handle
> objects, I believe, is because they operate somewhat differently than users
> may expect based on their experience with other object-oriented languages
> (in that they don't have destructors.)
>
> --
> Steve Lord
> slord@mathworks.com
>


Hi Steve,
One of the things I'm experiencing with my handle objects is that, when deleted, they are no longer in the workspace, but the memory isn't freed (or not all of it is). If I run "memory" before and after I delete the object and the net difference is smaller than the difference when creating. I am working on a continuously running deployed application that needs to run for long periods of time. I'm experiencing incremental memory increases with each callback run, can't figure out the source of the increases, and have not found a way to release the memory without closing and reopening the application.
Thanks!
~Andrew



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.