Friday, 1 June 2012

How to gather dump with DebugDiag. Perfcounters.

As I often need to explain, how to create dumps, I'm going to create a small tutorial for each kind of them. Here we start.
If you experience kind of memory leak, when process is just eating memory without giving OOM or StackOverflow, it would be good to create a dump at the moment when used memory is already high, but not that high to induce an application shutdown or other unwanted consequences.

First of all, you need to download DebugDiag tool: http://www.microsoft.com/en-us/download/details.aspx?id=26798

Then open DebugDiag 1.2 from your Start menu and here are your next steps:

Thursday, 10 May 2012

Timeouts when debugging in VS

If you are debugging a  w3wp process in VisualStudio, but it always breaks after some short time of inactivity, go to inetmgr, open Application Pools, select your pool, Advanced properties, and set Ping property to False:


Thursday, 3 May 2012

WinDBG bible. Chapter one.

And here I am, starting bunch of posts (I hope there will be more than one!) about simple windbg usage. All you need to know if you are new to memory debugging, but want to step in it.



First of all. What is memory dump? Memory dump can be simply explained as "photo" taken of all memory consumed by our process at some point of time. Looking at this photo, we can everybody pictured in it, and blame somebody for taking too much space or jumping into the foreground scene :)

How to create memory dump?

Thursday, 19 April 2012

I've just got in the situation where simple code like:

using (new SecurityDisabler()){
//publish item
}

didn't work.

I was so sure in fact that it should work because of my previous experience with Sitecore, that it took me some time to find the problem. And here it is: there is a setting Publishing.CheckSecurity in web.config. When it is set to true, Sitecore uses SecurityEnabler when publishes, so turning on SecurityDisabler before it makes no sense.

If you run into same question, just use UserSwitcher or disable Publishing.CheckSecurity.

Wednesday, 18 April 2012


To filter comments like <!-- smth with linebreaks --> in WinMerge:

1. Go to C:\Program Files (x86)\WinMerge, open IgnoreSectionMarkers.ini file
2. Delete everything that is there.
3. Put next lines in the file:


[set0]
StartMarker=<!--
EndMarker=-->
InlineMarker=<!--
FileType0=xml
FileType1=config

4. Save file and restart WinMerge.

To make these changes take effect, you need also next changes to WinMerge options:
"Compare" section: 
  • disable "Match similar lines" checkbox
  • enable "Filter comments" checkbox

Thursday, 12 April 2012


Simple WinMerge filter:


---
def: include ##will select all files without [filter below] in name

f: (2) ## Match all files with (2) in name
f: \.disable$
f: \.example$
f: \.bak$

Thursday, 5 April 2012

Very useful for Reflector:


If you use auto-properties instead of traditional ones they are named <Name>k__BackingField instead something like _Name.