As an additional detail, configuring the container with
AllComponentsReleasePolicy, as suggested by Tuna, doesn't change
anything, while using NoTrackingReleasePolicy I get the correct
behavior.

On Sep 9, 8:32 am, SimoneB <[email protected]> wrote:
> I think I finally got it, and it seems it's the burden issue once
> again, unless I'm missing something - which is likely, btw.
>
> I have my controller like so:
>
> class Controller
> {
>     public Controller(INonDisposableDependency
> nonDisposableDependency) { ... }
>
>     public Controller(IDisposableDependency disposableDependency)
> { ... }
>
> }
>
> I'm running on the trunk. At each request I resolve a controller from
> the container and don't explicitly do anything else on the container
> itself.
>
> Using the PerWebRequest lifestyle on the controller and independent
> from the lifestyle of the dependency, if I register a non disposable
> dependency into the container (the first constructor is called), at
> the end of the request both controller and dependency are released and
> collected when the GC runs.
>
> If I register a disposable dependency, instead (second constructor
> called), I see the number of instances of both controller and
> dependency growing up. The controller has roots in the microkernel,
> Burden property, and the dependency in both the Controller and the
> microkernel as well.
>
> All these considerations are made with the help of a profiler.
>
> On Sep 8, 3:21 pm, Tuna Toksoz <[email protected]> wrote:
>
> > I am not yet sure as i didn't have any time since i last looked at it, but
> > it is related to component burden of several months ago.It solved one
> > similar problem with components not being released, might help.
>
> > Let me know if it works, if it does, i will ask for a favor from any of you.
>
> > Tuna Toksöz
> > Eternal sunshine of the open source mind.
>
> >http://devlicio.us/blogs/tuna_toksozhttp://tunatoksoz.comhttp://twitt...
>
> > On Tue, Sep 8, 2009 at 9:18 AM, SimoneB <[email protected]> wrote:
>
> > > Tuna, what's the purpose of doing that?
>
> > > On Sep 8, 3:05 pm, Tuna Toksoz <[email protected]> wrote:
> > > > Can you both please try
> > > > container.ReleasePolicy = new Releasers.AllComponentsReleasePolicy();
>
> > > > Tuna Toksöz
> > > > Eternal sunshine of the open source mind.
>
> > >http://devlicio.us/blogs/tuna_toksozhttp://tunatoksoz.comhttp://twitt...
>
> > > > On Tue, Sep 8, 2009 at 8:57 AM, tom <[email protected]> wrote:
>
> > > > > I had a problem with it not releasing instances, and I got the latest
> > > > > and compiled and it took care of the problem.  This was just last
> > > > > week.  I really don't know if anything was changed, but for some
> > > > > reason it took care of the problem.  Just thought I would throw that
> > > > > out there.
>
> > > > > On Sep 8, 6:07 am, SimoneB <[email protected]> wrote:
> > > > > > Looking at the code of PerWebRequest related classes, I thought that
> > > > > > the components resolved are automatically released. Not sure though.
>
> > > > > > On Sep 8, 10:34 am, Ken Egozi <[email protected]> wrote:
>
> > > > > > > I *think* that whenever you explicitly Resolve, you have to
> > > explicitly
> > > > > > > Release.Dependencies resolved by windsor will get released when
> > > they
> > > > > aren't
> > > > > > > needed any more.
>
> > > > > > > On Tue, Sep 8, 2009 at 9:47 AM, SimoneB <[email protected]>
> > > > > wrote:
>
> > > > > > > > Hi there,
>
> > > > > > > > I'm having some issues with managing release of components in a
> > > web
> > > > > > > > application built on ASP.NET WebForms. I set up a MVC pattern
> > > where
> > > > > at
> > > > > > > > the beginning of the request I inject my controllers into the
> > > pages.
> > > > > > > > The controllers are registered with PerWebRequest lifestyle, and
> > > as I
> > > > > > > > see from the code they are supposed to be released by the
> > > container
> > > > > > > > when the request ends. They have several dependencies with mixed
> > > > > > > > lifestyles, and usign a profiler I notice that many of them are
> > > not
> > > > > > > > actually released, instead at each request the number of
> > > instances
> > > > > > > > grows up.
>
> > > > > > > > I'm pretty sure I'm doing something wrong so I wanted a heads up
> > > to
> > > > > > > > what to look for to investigate this issue. The controllers -
> > > which
> > > > > > > > are the only one I resolve explicitly from the container - 
> > > > > > > > depend
> > > on
> > > > > > > > several other components with mixed lifestyles some of which
> > > > > implement
> > > > > > > > the IDisposable interface - which I know caused issues in the
> > > past
> > > > > due
> > > > > > > > to a problem about component burden which afaik should be fixed
> > > now.
> > > > > > > > Is there anything specific I should be looking for to 
> > > > > > > > investigate
> > > > > this
> > > > > > > > issue?
>
> > > > > > > > Thanks
>
> > > > > > > --
> > > > > > > Ken Egozi.
>
> > >http://www.kenegozi.com/bloghttp://www.delver.comhttp://www.musicglue...
> > > כנס
> > > > > הקהילתי הראשון למפתחי דוטנט - בואו בהמוניכם
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to