MSDN Updates

Get Microsoft Silverlight

Wednesday, November 26, 2008

Performance Tuning in ASP.NET

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.

Monday, November 24, 2008

Meeting Jeff


I went to the Wintellect site the other day and got on Jeff's blog.
To my pleasant surprise, I saw that Jeff would actually be here in hyderabad. I immediately put in a note requesting him to meet me for a while. He replied back and said he would let me know. I was thrilled beyond words. When I came to know that I would be meeting him on Friday, I was so excited that everyone at my place knew that I was meeting him.
I waited outside the MS gate and there he was. With a very pleasant smile and a sore that :) we spoke for some time on a lot of topics. I was a little disappointed that I couldnt get to spend the whole afternoon (talk about wishful thinking eh :)) but it was awesome getting insights from the man himself!
We also did have a quick photo session! I did learn one thing though.. humility was at its best that day. I am now a bigger fan of the Wintellect team and I do hope to see them more often!