Memory leak SF BO with DevExpress ASPxDataGridView


Author
Message
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 thought that I close out this post as email was used to work through this process. 

There were a lot of posts here and so it is just a matter of time before people look back here for a solution.  In short, we have gone through this thoroughly and sufficiently proven that StrataFrame doesn't have a memory leak.  There was, however, a valid issue that this customer was dealing with in regards to a memory leak and a DevExpress grid.  Below are two memory profiles, one with a DevExpress grid and another with a standard GridView:

DevExpress Web Grid Memory Profile
http://forum.strataframe.net/Uploads/Images/2c06d1b4-7887-451e-b52a-78db.png
(Download the attachment for a better look)

The DevExpress web grid does have many objects still in memory as part of this process.  In most cases, this would probably not cause an issue as the "leak" was negligible.  But if you are retrieving a very large data set and dealing with many records, then this could be an issue.  Also, the more records that are in the data set, the DevExpress.Web.ASPxClasses (Display Classes) that will be created, thus increasing memory size.  This not not a fault of DevExpress, but more of an attribute to the complexity and functionality of their control.

GridView Memory Profile
http://forum.strataframe.net/Uploads/Images/be40a39e-b788-4de8-88d0-2e29.png
(Download the attachment for a better look)

In this example, the same test was performed.  A new property called AutoDisposeHandlersAndObjects was added to the WebBusinessBindingSource that allows the control to clean up automatically.  Though this can be used on the GridView and several others that have been tested (i.e. Infragistics), this will not work with the DevExpress Web Grid as the way that they enumerate the underlying data source prevents certain disposals from taking place, though the instance never grew past 1 BBS in our testing.  That said, you can see that in the GridView test, there are no BBS references remaining and the environment is much cleaner.  This is not a criticism of DevExpress web grid by any means, just an observation, as the GridView doesn't have the "pre-built" logic the DevExpress grid does.  But the BBS can be released as part of the process.

Closing
In closing, we are not saying that there is a bug in the DevExpress Web Grid, just noting some possible issues that you may run into during development.  If there were a bug, it would be in ASP.NET most likely anyway.  If nothing else, there could be some philosophical differences here in dealing with large data sets within a grid and/or how to enumerate the underlying data source.  DevExpress has many great tools and products and we highly recommend them, but like any development cycle, each project should be evaluated to see if a particular control will meet the needs for specific intents and purpose.  So this is just to make you aware of any possible issues that may be encountered when using a StrataFrame BBS and a DevExress Web Grid.

Attachments
DevEx_WebGrid_MemProfile.png (163 views, 29.00 KB)
GridView_MemProfile.png (174 views, 13.00 KB)
Edited 14 Years Ago by Trent L. Taylor
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
may i know no update mean what?haven't test, don't know the root cause yet, don't know solution yet or no plan to fix it?


None of the alternatives. It just means I haven't been updated on it.

My customers just can't keep waiting endless. We need at least a workaround.


That is understandable, but I need to remind you, as I have done before, that this has been considered an ASP.NET issue by your other third party grid vendor, which even openly stated that it wouldn't fix it, and what our developing team will try is to find you a workaround, if possible. All I know is that it is on their list.

This issue has been reported for more than a month, hope SF team understand our difficulty as well.


Yep, we all do and appreciate your business, and will try to help you as soon as possible, I am sure about it.

Cheers.
ChanKK
ChanKK
Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)
Group: Forum Members
Posts: 190, Visits: 1.3K
hi
any timeline?
may i know no update mean what?
haven't test, don't know the root cause yet, don't know solution yet or no plan to fix it?

My customers just can't keep waiting endless. We need at least a workaround.

This issue has been reported for more than a month, hope SF team understand our difficulty as well.

Thank you
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
No Chan, not yet.
ChanKK
ChanKK
Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)
Group: Forum Members
Posts: 190, Visits: 1.3K
any updates??
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Nope, this is what your DevEx support guys said, as you have posted before.

For a starter, although you already stated it would be pointless, a good test (or workaround) would be to put the DevEx control aside and create your own user control, populate it and see if it would work fine.

But it is on the list, and will be checked if there is anything that can be done.
ChanKK
ChanKK
Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)
Group: Forum Members
Posts: 190, Visits: 1.3K
Ivan George Borges (12/2/2010)
Thanks Chan.

Although this has been concluded as an ASP.NET issue, your message has been forwarded to be checked.


Hi
The log is sent by Microsoft, I doubt it is ASP.NET issue or not. But from the reply, it seem Microsoft NEVER mentioned it is ASP.NET issue.
Ivan George Borges
Ivan George Borges
Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)Strategic Support Team Member (4.9K reputation)
Group: StrataFrame MVPs
Posts: 1.9K, Visits: 21K
Thanks Chan.

Although this has been concluded as an ASP.NET issue, your message has been forwarded to be checked.
ChanKK
ChanKK
Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)
Group: Forum Members
Posts: 190, Visits: 1.3K
Hi,
Here is the reply from Microsoft. Hope it give some clue to SF team

I tried to reproduce the problemlocally and did some debugging. I am updating you with the current findings:

 

The problem should be related tohow EmployeesBO object is used.

 

1st time access todefault.aspx

=======================

 

10 EmployeesBO objects werecreated.

 

 

   Address        MT     Size  Gen

0x0628ddfc0x01b8d4c0      604    1BusinessObjectLibrary1.EmployeesBO

0x062e082c0x01b8d4c0      604    1BusinessObjectLibrary1.EmployeesBO

0x062e11600x01b8d4c0      604    1BusinessObjectLibrary1.EmployeesBO

0x062e19580x01b8d4c0      604    1BusinessObjectLibrary1.EmployeesBO

0x062e21500x01b8d4c0      604    1BusinessObjectLibrary1.EmployeesBO

0x062e29480x01b8d4c0      604    1 BusinessObjectLibrary1.EmployeesBO

0x062e31400x01b8d4c0      604    1BusinessObjectLibrary1.EmployeesBO

0x062e39380x01b8d4c0      604    1BusinessObjectLibrary1.EmployeesBO

0x062e41300x01b8d4c0      604    1BusinessObjectLibrary1.EmployeesBO

0x062e4ae4 0x01b8d4c0     604    1 BusinessObjectLibrary1.EmployeesBO

 

I checked the relationship ofthese objects. 0x0628ddfc seems to be a root object and be added to the sessionstate.

 

The other 9 EmployeesBO objectswere referenced by 0x0628ddfc.  (I have 9 records in the Employees table of NorthWinddatabase)

 

For example:

 

DOMAIN(011FF9F0):HANDLE(Strong):ee11fc:Root: 0e2701a4(System.AppDomain)->

 02272b40(System.ResolveEventHandler)->

 0227215c(System.Web.Compilation.BuildManager)->

  02272d44(System.Web.Compilation.MemoryBuildResultCache)->

 0e28bcf0(System.Web.Caching.CacheMultiple)->

 0e28bd08(System.Object[])->

 0e28ea10(System.Web.Caching.CacheSingle)->

 0e28eb24(System.Web.Caching.CacheExpires)->

 0e28eb44(System.Object[])->

 0e28ec94(System.Web.Caching.ExpiresBucket)->

 0a2b5fb4(System.Web.Caching.ExpiresPage[])->

 0a2b6038(System.Web.Caching.ExpiresEntry[])->

 022f5a04(System.Web.Caching.CacheEntry)->

 022f59d4(System.Web.SessionState.InProcSessionState)->

  0a285c28(System.Web.SessionState.SessionStateItemCollection)->

 0a285e3c(System.Collections.Hashtable)->

 0a285e74(System.Collections.Hashtable+bucket[])->

 0628e740(System.Collections.Specialized.NameObjectCollectionBase+NameObjectEntry)->

  0628ddfc(BusinessObjectLibrary1.EmployeesBO)->

  0a329b50(System.Data.DataTable)->

  0e393eec(System.Data.DataView)->

  0e398424(System.ComponentModel.ListChangedEventHandler)->

  0e395d48(System.Object[])->

  0e3960e8(System.ComponentModel.ListChangedEventHandler)->

  062e05e4(MicroFour.StrataFrame.Business.BusinessBindingSource)->

  062e0660(System.Collections.Generic.Dictionary`2[[System.Int32,mscorlib],[MicroFour.StrataFrame.Business.BusinessLayer, MicroFour StrataFrameBusiness]])->

  062e49c8(System.Collections.Generic.Dictionary`2+Entry[[System.Int32,mscorlib],[MicroFour.StrataFrame.Business.BusinessLayer, MicroFour StrataFrameBusiness]][])->

  062e4ae4(BusinessObjectLibrary1.EmployeesBO)

 

It seems that the object0x062e4ae4 was referenced by 0628ddfc through DataTable object and eventhandlers. (highlighted)

 

2nd  time accessto default.aspx

=======================

9 new objects were created andthey were all referenced by the root object 0x0628ddfc which was in turn referenced bysession state.

 

0x0e3985a00x01b8d4c0      604    0BusinessObjectLibrary1.EmployeesBO

0x0e398f540x01b8d4c0      604    0BusinessObjectLibrary1.EmployeesBO

0x0e3997900x01b8d4c0      604    0BusinessObjectLibrary1.EmployeesBO

0x0e399fcc0x01b8d4c0      604    0BusinessObjectLibrary1.EmployeesBO

0x0e39a8ac0x01b8d4c0      604    0BusinessObjectLibrary1.EmployeesBO

0x0e39b1180x01b8d4c0      604    0BusinessObjectLibrary1.EmployeesBO

0x0e39b954 0x01b8d4c0     604    0 BusinessObjectLibrary1.EmployeesBO

0x0e39c2200x01b8d4c0      604    0BusinessObjectLibrary1.EmployeesBO

0x0e39cbc80x01b8d4c0      604    0BusinessObjectLibrary1.EmployeesBO

 

 

DOMAIN(011FF9F0):HANDLE(Strong):ee11fc:Root: 0e2701a4(System.AppDomain)->

 02272b40(System.ResolveEventHandler)->

 0227215c(System.Web.Compilation.BuildManager)->

 02272d44(System.Web.Compilation.MemoryBuildResultCache)->

 0e28bcf0(System.Web.Caching.CacheMultiple)->

 0e28bd08(System.Object[])->

  0e28ea10(System.Web.Caching.CacheSingle)->

 0e28eb24(System.Web.Caching.CacheExpires)->

 0e28eb44(System.Object[])->

 0e28ec94(System.Web.Caching.ExpiresBucket)->

 0a2b5fb4(System.Web.Caching.ExpiresPage[])->

 0a2b6038(System.Web.Caching.ExpiresEntry[])->

  022f5a04(System.Web.Caching.CacheEntry)->

 022f59d4(System.Web.SessionState.InProcSessionState)->

 0a285c28(System.Web.SessionState.SessionStateItemCollection)->

 0a285e3c(System.Collections.Hashtable)->

 0a285e74(System.Collections.Hashtable+bucket[])->

 0628e740(System.Collections.Specialized.NameObjectCollectionBase+NameObjectEntry)->

  0628ddfc(BusinessObjectLibrary1.EmployeesBO)->

 0a329b50(System.Data.DataTable)->

 0e393eec(System.Data.DataView)->

 0e398424(System.ComponentModel.ListChangedEventHandler)->

 0e395d48(System.Object[])->

 0e398404(System.ComponentModel.ListChangedEventHandler)->

 0e39822c(MicroFour.StrataFrame.Business.BusinessBindingSource)->

 0e398270(System.Collections.Generic.Dictionary`2[[System.Int32,mscorlib],[MicroFour.StrataFrame.Business.BusinessLayer, MicroFour StrataFrameBusiness]])->

 0e39ca78(System.Collections.Generic.Dictionary`2+Entry[[System.Int32,mscorlib],[MicroFour.StrataFrame.Business.BusinessLayer, MicroFour StrataFrameBusiness]][])->

  0e399fcc(BusinessObjectLibrary1.EmployeesBO)

 

 

In addition, I found theseobjects were referenced byMicroFour.StrataFrame.Business.BusinessLayer.SharedDataTableCollection.

 

DOMAIN(011FF9F0):HANDLE(Pinned):fe11f4:Root: 12277ad8(System.Object[])->

  0628e08c(MicroFour.StrataFrame.Business.BusinessLayer+SharedDataTableCollection)->

 0628e0a0(System.Collections.Generic.Dictionary`2[[System.String,mscorlib],[System.Collections.Generic.List`1[[MicroFour.StrataFrame.Business.BusinessLayer,MicroFour StrataFrame Business]], mscorlib]])->

 062e1104(System.Collections.Generic.Dictionary`2+Entry[[System.String,mscorlib],[System.Collections.Generic.List`1[[MicroFour.StrataFrame.Business.BusinessLayer,MicroFour StrataFrame Business]], mscorlib]][])->

  062e10d4(System.Collections.Generic.List`1[[MicroFour.StrataFrame.Business.BusinessLayer,MicroFour StrataFrame Business]])->

 062e4928(System.Object[])->

 062e082c(BusinessObjectLibrary1.EmployeesBO)

 

 

Recommendation

==============

If I use multiple users(multiple sessions) to do load test, the memory usage increases quickly becausethere will be multiple root EmployeesBO objects which are stored in sessionstate.

 

Please do involve yourdevelopers of these components (e.g. MicroFour.StrataFrame.Business.BusinessBindingSource,BusinessObjectLibrary1.EmployeesBO,MicroFour.StrataFrame.Business.BusinessLayer.SharedDataTableCollection) tocheck the logic relationship of these components.

 

If they want to keep a copy ofthe data, please make sure only keep one copy.


ChanKK
ChanKK
Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)Advanced StrataFrame User (622 reputation)
Group: Forum Members
Posts: 190, Visits: 1.3K
Hi
still no luck?
I would like to know if SF team able to reproduce it or not ?

Anyway, I have escalate this issue to Microsoft, by utilize my company MS Incident support token.

Thank you
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search