I don't understand why this isn't the default setting either. IMHO,
Transient objects should not be tracked by default.
As many several have noticed the issues arising tracking transient
objects for dispose is greater then the risk of not calling dispose at
all (and unless the object holds unmanaged resources, dispose is not
all that necessary anyway). A disposable component that *must be
disposed* should also implement a finalizer and that doesn't change by
using a container since there is no guarantee dispose will be called
on container either. Since release accepts the object to dispose as a
parameter there isn't any reason to track it, if object is not tracked
then assume it is transient and call dispose if implemented.
- Kurt
On Mar 3, 4:57 pm, Andrew Smith <
andy78sm...@gmail.com> wrote:
> Yea, I was worried about negative effects of this also. You don't get
> something for nothing, right? The only mention I've seen so far is a comment
> from hammett in the another post to this group ("ViewComponent memory
> leak"):
>
> "The side effects is that you might have disposable components that are
> not being disposed by the container"
>
> In my case I know I don't have any disposable components involved, so after
> some proper testing, I'll be applying the 'fix' to my server
>
> On Tue, Mar 3, 2009 at 11:45 PM, Stefan Sedich <
stefan.sed...@gmail.com>wrote:
>
>
>
> > Excellent glad I could help. But I would look into releasing your
> > objects properly, not sure maybe someone can comment on negative
> > impacts of using NoTrack policy.
>
> > Cheers
>
> > On Wed, Mar 4, 2009 at 9:43 AM, Andrew Smith <
and...@emertech.ie> wrote:
> > > just changed the policy and re-ran a local stress test. Immediate
> > > improvement. Previous test ended with memory usage of ~200MB, this time
> > > round 70MB
> > > thanks again!
>
> > > On Tue, Mar 3, 2009 at 11:37 PM, Stefan Sedich <
stefan.sed...@gmail.com>
> > > wrote:
>
> > >> No problems,
>
> > >> Something that caught me too, I knew a few people that were not aware
> > >> and they had never stress tested their apps or realised it was
> > >> resetting (dangerous). I am glad I profile my stuff before putting it
> > >> anywhere near production. I guess releasing is the way proper way to
> > >> handle things, but I have been naughty and just used NoTracking.
>
> > >> Cheers
>
> > >> On Wed, Mar 4, 2009 at 9:33 AM, Andrew Smith <
andy78sm...@gmail.com>
> > >> wrote:
> > >> > Hi Stefan,
> > >> > you know as soon as I posted that, of course I came across details on
> > >> > this
> > >> > issue. In fact your very blog post. In all the time I've used castle,
> > I
> > >> > never realised I was expected to explicitly release a transient
> > >> > component.
> > >> > By the sounds of it, I'm sure that will be the cause as I'm using
> > >> > windsor
> > >> > integration heavily and can easily repro the issue with a local stress
> > >> > test.
> > >> > Thanks for the info
> > >> > Cheers,
> > >> > Andrew
>
> > >> > On Tue, Mar 3, 2009 at 11:24 PM, Stefan Sedich <
> >
stefan.sed...@gmail.com>
> > >> > wrote:
>
> > >> >> Andrew,
>
> > >> >> I have built a few simmilar sounding shop fronts, with medium load
> > and
> > >> >> have not had issues with memory leaks with the app pools running
> > solid
> > >> >> until their nightly reset.
>
> > >> >> If you hit your site with a web stress testing tool do you see the
> > >> >> memory continue to climb until app pool reset? If this is the case it
> > >> >> is possible you have a memory leak.
>
> > >> >> I would suggest getting a tool like ANTS profiler to see if you can
> > >> >> track down any memory leaks in your application and then go from
> > >> >> there. I would say from what I have seen in my apps ~200MB seems
> > >> >> reasonable depending on what it is doing.
>
> > >> >> In my last project I had similar issues you describe. In my case I
> > was
> > >> >> using Windsor and not releasing my components from the container when
> > >> >> I was done with them. In my case I decided to not release my objects
> > >> >> and use the NoTrackingReleasePolicy instead, as this was fine for my
> > >> >> needs and removed the leak that I had.
>
> > >> >> I have blogged about this here:
>
> >
http://weblogs.asp.net/stefansedich/archive/2008/11/05/avoid-memory-l...