I have a situation here.
We have a search criteria which returns about 70K + records. We have paging and the option to export to Excel. The earlier design was using caching which I promptly got it removed. Caching is not on a per user basis. So if there are two users trying to get the same report with different search criteria, one of them is surely in for a rude shock!
I ran the perf mon and saw that the large object heap size was going in GB's. The Gen 2 heap size was also huge.
So after reading this post from Tess i came to this conclusion.
Solutions:-
Option I- Session
The primary concern is disposing the objects after usage. If we run the perfmon, we see that the data gets moved to the Gen2. This is not good. The large object heap size also goes in GB's.
Option II - Cache
This seems to be the better solution under the circumstances. The advantages of using caching is that we can set the expiry to say 20 minutes. IN order to use the cache for each user, we can use the cache key as "Session.SessionID". This will be unique for each user.
This also moves the the object to Gen2 but from what I have seen, ASP.NET takes care of disposing the cached objects as and when it faces memory issues OR "memory pressures".
Additionally in the Session End event in Global.asax, we can remove the cache item.
Option II still has some issues to be resolved.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment