Releasing memory properly when using a BBS


Author
Message
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
I have numerous DevExpress grids and tree list controls in my application which I am binding to BOs using BusinessBindingSource controls.  I have recently discovered that DevExpress does a very poor job of releasing memory and disposing of their own object properly.  I have a lot of memory leaks coming up in my app because of this.  Now, to the part where SF is involved...I have been running memory profilers which are showing that the grids, trees, etc are still linked to the BBS which is preventing them from being disposed of properly at garbage collection. 

My theory is that the BBS is somehow dynamically creating columns in the grid or tree at runtime, but not manually disposing of them when it's unloaded.  DevExpress basically expects you to dispose of everything, so I'm wondering if somehow the BBS is still linked to the DevExpress controls and preventing them from being released from memory correctly.  Is this a possibility?

I can open and close a test form I have created without filling the BO that is linked to the BBS, and it releases all memory correctly when the form is closed.  If I fill the BO when opening the form, it will not release all memory once closed.  Any ideas here?

Replies
Andria Jensen
Andria Jensen
Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)Advanced StrataFrame User (600 reputation)
Group: Forum Members
Posts: 336, Visits: 497
I think I understand what you are saying...basically, depending on the area where you fill a BO it may or may not get registered with the collection that the GC uses to dispose of objects in memory during collection cycles.  Is that right? 

But, if I am manually disposing of the BO and the BBS in the FormClosed event, shouldn't this be enough no matter where it's being filled or instantiated? 

Also, what is the proper and recommended way to manage memory as far as StrataFrame objects go?  Should we be manually disposing of things when they are no longer in use or is it ok to leave that to the GC?

Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
I think I understand what you are saying...basically, depending on the area where you fill a BO it may or may not get registered with the collection that the GC uses to dispose of objects in memory during collection cycles.  Is that right? 

Yes.

But, if I am manually disposing of the BO and the BBS in the FormClosed event, shouldn't this be enough no matter where it's being filled or instantiated? 

Not if something holds on to an event or an instance binding and will not release it.

Also, what is the proper and recommended way to manage memory as far as StrataFrame objects go?  Should we be manually disposing of things when they are no longer in use or is it ok to leave that to the GC?

If you drop an instance on the form, the Dispose should be intrinsically called as all BOs inplement the IDidposable interface.  If done in code, then manually Dispose of the object.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Andria Jensen - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Andria Jensen - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Andria Jensen - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Andria Jensen - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Andria Jensen - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Andria Jensen - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Andria Jensen - 17 Years Ago
             No problem, glad to help :)
Trent L. Taylor - 17 Years Ago
Andria Jensen - 17 Years Ago
Andria Jensen - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Purnell W Glenn - 11 Years Ago
Trent L. Taylor - 11 Years Ago
Danny Doobay - 12 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search