Slow parallel code

Started by
9 comments, last by Narf the Mouse 11 years, 9 months ago

[quote name='Narf the Mouse' timestamp='1340734312' post='4953086']
I'll check if it's the garbage collector - Does anyone know of a free/cheap memory profiler? Manually checking probably wouldn't be quite as easy.


CLR Profiler is good and free. I seem to remember there being some trick to making it work with XNA but I don't recall what it was at the moment. It will tell you what you're allocating, how much, where and when.

You can use the the performance counters exposed by .NET to view what the GC is doing. Basically you go start->run "perfmon.exe" and add counters from under ".NET CLR Memory" to your graph. You can set it up to only show GC info for your specific program too.
http://msdn.microsof...y/x2tyfybc.aspx
http://blogs.msdn.co.../03/148029.aspx

Also, one trick I have used is to just make a single object that is only referenced via a WeakReference, and every frame check if that WeakReference's Target is now null. In my game I plot these events on a scrolling graph and their frequency tells me how often gen0 collections are happening, which tells me how much garbage I am generating per frame. But that method requires more game-specific setup than the CLR Profiler/Performance Counter route.
[/quote]
Thanks; downloaded the CLR profiler.

Sorry for the late response.

This topic is closed to new replies.

Advertisement