Activity overview
Latest activity by springy
I started the original post with these counters -- at least the pure counting ones.
Even though it's a performance problem maybe it's easier to tackle this problem using Memory profiler since Memory profiler already disabled concurrent garbage collections.
My main problem is that I see the counters increasing rapidly but don't have a clue where and why so many objects get created -- at least they don't get leaked. Most likely the main cause are these hidden LINQ closures, iterator implementation classes and hidden classes created by LINQ expressions. / comments
I started the original post with these counters -- at least the pure counting ones.
Even though it's a performance problem maybe it's easier to tackle this problem using Memory profiler since Memor...
I see, Red Gate has no motivation in improving their products. / comments
I see, Red Gate has no motivation in improving their products.
Another sample of hidden object creation, a LINQ query using "let" (against a LINQ-to-SQL AdventureWorks DB): from h in this.TransactionHistory.AsEnumerable()
let x = h.ActualCost / h.Quantity
where x > 0
let y = char.GetUnicodeCategory(h.TransactionType)
orderby h.TransactionDate, y
select h
This gets translated to ILASM code whose C# translation looks like this:
.Select (
h =>
new
{
h = h,
x = (h.ActualCost . (Decimal)(h.Quantity))
}
)
.Where (temp0 => (temp0.x > 0))
.Select (
temp0 =>
new
{
temp0 = temp0,
y = Char.GetUnicodeCategory (temp0.h.TransactionType)
}
)
.OrderBy (temp1 => temp1.temp0.h.TransactionDate)
.ThenBy (temp1 => temp1.y)
.Select (temp1 => temp1.temp0.h)
So although I'm using only a well known object (of type TransactionHistory) there have been created 2 additional anonymous (and temporary) classes for each instance of TransactionHistory I`m retrieving from the DB.
While the temporary object most likely won't get promoted to Gen1 this still puts a load on GC collections which would be avoidable at all by refactoring the code into something smarter. / comments
Another sample of hidden object creation, a LINQ query using "let" (against a LINQ-to-SQL AdventureWorks DB):from h in this.TransactionHistory.AsEnumerable()
let x = h.ActualCost / h.Quanti...
I don't know if it would have helped. But from the choice of the 2 ANTS Profilers and the Memory tracker the last one was most promising.
Since Memory Profiler already forces non-concurrent garbage collections maybe changes are higher in finding or at least narrowing down problem areas with this tool? / comments
I don't know if it would have helped. But from the choice of the 2 ANTS Profilers and the Memory tracker the last one was most promising.
Since Memory Profiler already forces non-concurrent garbage...
My goal is to find the regions where problems are. So !dumpheap could only help when I know where to stop and debug this using SOS.
ANTS Memory Profiler does not help, too, since there are no memory leaks -- but there is heavy GC usage which I want to reduce.
The problem is that there are many hidden places where objects could be created, for example when using LINQ with lambdas which create closures. This is happening behind the scenes, there is no "new SomeObject()" constructor call you easily could spot. / comments
My goal is to find the regions where problems are. So !dumpheap could only help when I know where to stop and debug this using SOS.
ANTS Memory Profiler does not help, too, since there are no memor...
Sorry for being not precise enough:
I'm speaking of routines/methods which get called some million times and where it's very likely that short living (=Gen0 and Gen1) memory is allocated and freeded at recurring places -- which I want to isolate.
What I've read about your alpha/beta programm "Memory Tracker" seems to be which I'm looking for. Unfortunately it doesn't work -- either it's not compatible with .NET 4 / 64bit or something different. / comments
Sorry for being not precise enough:
I'm speaking of routines/methods which get called some million times and where it's very likely that short living (=Gen0 and Gen1) memory is allocated and freede...
analyze time spent in garbage collector
Can Performance Profiler help me in finding out where in my code Gargabe Collection occurs the most time?
There exist 3 performance counters "# Gen X Collections" but they are just increasing stead...
Chris.Allen wrote:
The profiler doesn't have a snapshot model. It has a "time-line" model where you profile all of your application and if you need to filter out specific times, you can click and drag on the time line.
Yeah, and I can created pinned+named regions out of the selection -- and that's exactly what I wanted to pregenerate automatically from within the profiled application; just the same way as I can create snapshots when profiling memory.
Chris.Allen wrote:
So, two things that might help you are "user events"- this is a way of 'synchronizing' your code to the time line. Please check the out here: http://www.red-gate.com/supportcenter/C ... wledgebase\ANTS_Performance_Profiler\KB200811000319.htm&p=ANTS%20Performance%20Profiler
(its not restricted to ASP.NET).
I'll give it a try.
But one thought so far:
The doc says
"provided there were no concurrent accesses to this page or background threads"
:
Since the profiler already has the possibility to filter by a specific thread, why not capture the thread which triggered the user-event (or the creation of a pinned region). / comments
Chris.Allen wrote:
The profiler doesn't have a snapshot model. It has a "time-line" model where you profile all of your application and if you need to filter out specific times, you can click an...
jrg wrote:
it contains two separate installers
Oops. Sorry, I did not think about the possibility that the zipped EXE's are installers.
Thanx for clarifying this. / comments
jrg wrote:
it contains two separate installers
Oops. Sorry, I did not think about the possibility that the zipped EXE's are installers.
Thanx for clarifying this.
create and bookmark regions from code?
Hello,
does there exist something similar to
RedGate.MemoryProfiler.Snapshot.TakeSnapshot()
for the Performance Profiler?
I would prefer an IDisposable pattern which records the region-end...