p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio (http://p2p.wrox.com/book-asp-net-3-5-enterprise-application-development-visual-studio-2008-problem-design-solutio-477/)
-   -   Array Size Limit Issue (http://p2p.wrox.com/book-asp-net-3-5-enterprise-application-development-visual-studio-2008-problem-design-solutio/85581-array-size-limit-issue.html)

hasanboby November 4th, 2011 12:45 PM

Array Size Limit Issue
 
Hi,

I have used this framework in developing an online job search and recruitment system and number of users are growing day by day. I have now 11336 users in ENTUserAccount table with candidate role. I am now getting out of memory exception when loading long list of users, roles and there capabilities. I came to know that there is Array Size Limit in .net/Dotnet framework. I cannot hold that many users in single array or collection. I think this is not scalable approach.
Following are my findings on Array Size Limit Issue based on data read from Live DB backup:

Users Cached List is a list of 11336 ENTUserAccount objects. Each ENTUserAccount contains ENTRole (1 per user mostly). Each ENTRole contains 30 RoleCapabilities and 11336 RoleUserAccounts. i.e. The list contains 11336 * 1 *(30 + 11336) objects of different types.

Logically, it doesn't seem to be appropriate having RoleUserAccounts in users' list.

As far as the use of Users Cached List is concerned, from most of the locations, application is just reading basic properties of ENTUserAccount e.g. ID and Display Text etc. There are some locations where application uses ENTUserAccount->Roles but ENTUserAccounts->Roles->RoleUserAccounts is never used from the cached list.

As per my knowledge, Role.aspx page is the only location which needs ENTRole->RoleUserAccounts and it doesn't read this data from the cached list rather it fetches the data from database when Role.aspx page is loaded for a role.

We can use some function to load ENTRole->RoleUserAccounts and ENTRole->RoleCapabilities on loading Role.aspx page but I think we should keep ENTRole->RoleUserAccounts and ENTRole->RoleCapabilities empty as there is no point to populate these lists and keep them in cache when these are never used. Just for your notice, Role.aspx page is loading both of the lists from database not from the cache.

I might be wrong so please let me know what are your views on this, please help if you have any suggestion.


All times are GMT -4. The time now is 07:38 PM.

Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
2013 John Wiley & Sons, Inc.