Castle Windsor Interceptor Usage

Use this forum to read, ask or inform about memory issues in the .NET Framework and third party components.
Post Reply
Joined:Tue Dec 28, 2021 10:41 pm
Castle Windsor Interceptor Usage

Post by GaxUser » Tue Dec 28, 2021 10:48 pm

I seem to be experiencing a memory leak when using castle interceptors. I create components via a factory and if I dispose those components they do not get GCed. I'm not sure what I could be doing wrong, or what I need to do to alleviate the problem. Is there a way to unhook the interceptor or I'm I misunderstanding the real problem?

Andreas Suurkuusk
Joined:Wed Mar 02, 2005 7:53 pm

Re: Castle Windsor Interceptor Usage

Post by Andreas Suurkuusk » Wed Dec 29, 2021 8:00 pm

I'm not sure how interceptors in Castle Windsor are implemented, and it's hard to tell from the screenshot which types belong to Windsor and which are your own types.

The screenshot does show that the disposed LabelViewModelProxy is kept alive as a key in the "instance2Burden" dictionary. Since this is a strong reference, the LabelViewModelProxy instance must be removed from the dictionary somehow, to allow it to be garbage collected. If you have control over the instance2Burden dictionary, I recommend that you try to remove the LabelViewModelProxy instance when it is disposed.

To give you better help with identifying the memory leak, it would be good if you could send us a session file. You can contact us at for information on how to send a session file to us.
Best regards,

Andreas Suurkuusk
SciTech Software AB

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest