Who is bad

by: Ruwen Jin

One way to get notifications from EPiServer is listen to EPiServer.DataFactory events. This is great. However this must be done carefully otherwise it will cause memory leaks and other strange behavior on site. When this happens normally we take memory dumps and analyze the memory dump. It could take long time since you need do the memory dump and copy to your local computer and so on.

 

Here is a simple solution. By using reflection we can list all pageeventhandlers that listen to datafactory events. When we see that there are multiple instance listen to same event from same module, we could go further on that module.

 

Installation is just copy the aspx file to your EPiServer site and browse to that aspx page.

 

Download it here.

 

It has been tested on EPiServer CMS 5 R2SP2 and EPiServer CMS 6 CTP 2.

I will try to implement same stuff to VPP and make it as gadget  when I got more time. :)

09 November 2009

Tags:


Comments

  1. Could you clarify "carefully" and how it should be done and why and when it causes memory leaks?
  2. Since DataFactory.Instance is static and a long life object, any listener object hooks to it will not be released ( GCed ). That is why we need be careful when we hook to event. We need make sure that it wont hook the event multiple times and release the hook on dispose event.
  3. maybe one more blog post is needed
Post a comment    
User verification Image for user verification  
EPiTrace logger