Software development, .Net, SQL Server, TDD, Agile, Community and other Odds and Sods
Mitch Wheat has been working as a professional programmer since 1984, graduating with a honours degree in Mathematics from Warwick University, UK in 1986. He moved to Perth in 1995, having worked in software houses in London and Rotterdam. He has worked in the areas of mining, electronics, research, defence, financial, GIS, telecommunications, engineering, and information management. Mitch has worked mainly with Microsoft technologies (since Windows version 3.0) but has also used UNIX. He holds the following Microsoft certifications: MCPD (Web and Windows) using C# and SQL Server MCITP (Admin and Developer). His preferred development environment is C#, .Net Framework and SQL Server. Mitch has worked as an independent consultant for the last 10 years, and is currently involved with helping teams improve their Software Development Life Cycle. His areas of special interest lie in performance tuning
Thursday, November 25, 2010
SQL Server 2008: Using Hex Values in TSQL Scripts
I was updating several TSQL scripts today containing ARGB values and thinking (not for the first time) that it was a shame I couldn’t use the Hex values directly (eg 0xFFB40000) rather than converting to the harder to manage base10 integer equivalent (-4980736).
The SQL Server 2008 release updated the CONVERT() function to be able to do just that!
CONVERT(varbinary(4), '0xFFB40000', 1)
The last Style parameter governs the the conversion.
From Books Online:
Tuesday, November 23, 2010
ASP.NET Code Samples Collection
If you missed this in the last MSDN Flash, J. D. Meier (Developer Guidance, Patterns & Practices) has a roundup of various ASP.NET code sample on his blog: ASP.NET Code Samples Collection
Saturday, November 13, 2010
Determine if your .NET Application has a Memory Leak
You can use Perfmon to determine if your .NET application is leaking memory (managed or unmanaged).
Run Perfmon.exe and add these counters:
Run your application for a representative length of time and exercise its functionality.
If Private bytes is increasing but # bytes in all heaps is not, then unmanaged memory is leaking. If both both are increasing, then managed memory is leaking. If the # of current logical threads is increasing beyond what you expect, then thread stacks are leaking.
If Private Bytes is periodically jumping in 1MB increments with a corresponding increase in # of current logical Threads, a thread stack leak is the likely cause.
Sunday, November 07, 2010
.NET CLR Large Object Heap
I was recently talking to several colleagues about the CLR garbage collector, and the question of where the size of 85,000 bytes as the threshold for objects on the Large Object Heap (LOH) comes from (instead of the seemingly more obvious value of 65,535).
This value was determined as a result of performance tuning by the CLR garbage collector team.
One of the reasons you should try to keep your object allocation sizes below this value (and off the Large Object Heap) is because unlike the Generation 0,1 and 2 area, the LOH is not compacted.
An excellent reference for the LOH is here: Large Object Heap Uncovered
There were changes made in .NET 4.0 as to how the LOH performs, but according to this connect issue there are still improvements that could be made:
.NET 4.0 introduced differences between the workstation and server versions of the garbage collector:
Tuesday, November 02, 2010
Reminder: Perth .NET User Group Meeting: Thurs Nov 4th, Production .NET Debugging with Piers Williams
In this talk, you will learn how to debug your application in the field with this exploration of advanced debugging techniques for managed code applications. Hang, crash, leak or other – we will go beyond Visual Studio debugging and talk about replicating and isolating problems using Perfmon, WMI, WinDbg, and automating the diagnosis with PowerShell using PowerDbg.
Piers is a .NET Architect with Beacon Technology, and a contributor to PowerDbg (http://powerdbg.codeplex.com).
There will be a door prize of a choice of license from JetBrains (one of ReSharper , TeamCity Build Agent, dotTrace Profiler, RubyMine, IntelliJ IDEA), and several coupons to Tekpub's high-quality, online screencasts for programmers.
If you have any problems getting in to the venue, please call me on 0422 971 731
MSN, Email: mitch døt wheat at gmail.com