Re: Running GUI application in separate application domain
- From: nickdu <nickdu@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 7 Oct 2005 06:20:02 -0700
I'm pretty certain is has to do with Security Runtime Checks. When I turn
Code Access Security off (caspol -s off) the performance is fine and of
course the runtime security checks perfmon counter is zero.
This is where some of the confusion comes in. When CAS is turned on
sometimes the performance is good and sometimes it isn't. However, ever
since I've started looking at the security runtime checks performance counter
I've noticed that every time the performance is slow I'm doing huge amounts
of runtime security checks. On the order of 3200/sec. When CAS is on and
the peformance is good the runtime security checks counter is much lower,
maybe 300/sec - 500/sec. I can't figure out why sometimes this counter will
be high and other times it will be low for the same assemblies. I've
literally ran the program once and noticed poor performance and then ran the
same program again (no changes) and noticed good performance. Again, the
poor performing run was generating loads of runtime security checks and the
good performing run was not.
--
Thanks,
Nick
"nickdu" wrote:
> I just ran some more tests and captured perfmon logs for the two different
> scenarios. When I run the GUI components in the default app domain I get the
> following results (I only lists the ones that are significantly different and
> could potentially indicate the problem).
>
> .NET CLR Security\Total Runtime Checks: Min=122,443 Max=358,890 Delta=~236,000
> .NET CLR Memory\# Gen 0 Collections: Min=149 Max=9927 Delta=~9800
> .NET CLR Memory\% Time in GC: Average=6
> .NET CLR Memory\Allocated Bytes/sec: Average=12MB
> .NET CLR Memory\Finalization Survivors: Average=344
>
> The same counters for the scenario where the components are run in an
> appdomain different from the default domain is:
>
> .NET CLR Security\Total Runtime Checks: Min=124,677 Max=1,475,320 Delta=~1.3M
> .NET CLR Memory\# Gen 0 Collections: Min=762 Max=69,766 Delta=~69,000
> .NET CLR Memory\% Time in GC: Average=17
> .NET CLR Memory\Allocated Bytes/sec: Average=32MB
> .NET CLR Memory\Finalization Survivors: Average=38
>
> For for some reason running these components in a different application
> domain drastically increased the # of runtime security checks, # of gen 0
> collections, % Time in GC, and the allocated bytes/sec. Note that the server
> which generates the real time data feed is the same in both cases.
>
> Any ideas?
> --
> Thanks,
> Nick
>
>
> "nickdu" wrote:
>
> > I'm hoping it's not related as I'm not attempting to share components across
> > appdomains.
> > --
> > Thanks,
> > Nick
> >
> >
> > "David Levine" wrote:
> >
> > > I'm not sure if this applies to your situation...there is a limitation in
> > > the current BCL that prevents GUI components from being instantiated in
> > > separate appdomains and that are all hosted in a GUI framework running in
> > > its own appdomain. In other words, you cannot share GUI components across
> > > appdomains. It's not that everything does not work, but some important
> > > aspects don't work right. You can run a GUI framework in an appdomain other
> > > then the default and have it host other GUI components, so long as all the
> > > GUI pieces are all running in the same appdomain. You can share non-GUI
> > > components across appdomain boundaries without apparent problems (otherwise
> > > remoting would be completely useless). This may be related to the
> > > performance problem you are seeing.
> > >
> > >
> > > "nickdu" <nickdu@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> > > news:E9209AD2-0F3E-4882-A8F8-3A7BB35FF6F4@xxxxxxxxxxxxxxxx
> > > > By the way, I talk about performance but I guess some may be confused
> > > > about
> > > > what I mean. The components are grid components (classes derived from the
> > > > SyncFusion grid) which are displaying real-time data updates over a TIB
> > > > bus.
> > > > When these same components are all run in the default application domain
> > > > the
> > > > application can keep up with the real-time updates. When I create two of
> > > > the
> > > > grids in one appdomain and two in another the performance decreases
> > > > drastically.
> > > >
> > > > --
> > > > Thanks,
> > > > Nick
> > > >
> > > >
> > > > "nickdu" wrote:
> > > >
> > > >> What marshaling? All the components are created in their appdomain.
> > > >> There
> > > >> should be no marshaling going on.
> > > >>
> > > >> Also, forget my last post. I ran it again with all the components in one
> > > >> appdomain, other than the main appdomain, and the performance was very
> > > >> poor.
> > > >> I guess the first time I tried that was just some sort of fluke. Though
> > > >> I
> > > >> don't believe in flukes. My guess is that something is screwed up and
> > > >> most
> > > >> of the time it's screwed up in the same way which causes the performance
> > > >> problem.
> > > >> --
> > > >> Thanks,
> > > >> Nick
> > > >>
> > > >>
> > > >> "John Murray" wrote:
> > > >>
> > > >> > I suspect that most of your problem is related to Marshalling the
> > > >> > objects across the app domains. The additional objects that are needed
> > > >> > to create this and the proxies could the additional GC work that needs
> > > >> > to occurs.
> > > >> >
> > > >> >
> > > >> >
> > > >> >
> > > >> >
> > > >> > nickdu wrote:
> > > >> > > I've got some additional information. Via configuration I was able
> > > >> > > to move
> > > >> > > all these components into a single application domain, separate from
> > > >> > > the
> > > >> > > default domain. The performance of this matches the performance of
> > > >> > > the
> > > >> > > existing application where all the components are in the default
> > > >> > > domain. In
> > > >> > > both of these scenarios I noticed the % Time in GC is around 7%.
> > > >> > > When these
> > > >> > > components are spread across two application domains the % Time in GC
> > > >> > > is
> > > >> > > around 20% and as I mentioned the performance appears to be about 10x
> > > >> > > worse.
> > > >> > > I'm running the application from my laptop which is a single
> > > >> > > processor
> > > >> > > machine. Why would separating the work of a single application to
> > > >> > > multiple
> > > >> > > application domains have such a drastic change on the GC?
> > > >> >
> > >
> > >
> > >
.
- References:
- Re: Running GUI application in separate application domain
- From: David Levine
- Re: Running GUI application in separate application domain
- From: nickdu
- Re: Running GUI application in separate application domain
- From: nickdu
- Re: Running GUI application in separate application domain
- Prev by Date: ANN: Decompiler.NET limited version available FREE to all MSDN Subscribers
- Next by Date: Re: problems...
- Previous by thread: Re: Running GUI application in separate application domain
- Next by thread: RE: Nested DataGrid using Relations sorting child
- Index(es):
Relevant Pages
|