Click here to monitor SSC

Bart

Software Engineer - Red Gate Software

.NET Oddities #3

Published Thursday, November 24, 2005 3:00 PM

OK, so I'll admit this is a bit cheeky: this entry should almost certainly be .NET Oddities #2a because it's so closely related to #2, but there. You may have noticed, and in fact I already knew this, that OutOfMemoryException (like StackOverflowException) has a null value for its StackTrace property. Again, this can be a total pain in the butt, however fortunately for me it was Dan that did the hard work and tracked it down this morning (for which I'm exceedingly grateful). Of course, things are never quite that simple, and it turned out that the bug behind all of this was actually elsewhere in the code, so I didn't totally escape having to do some work.

I should also qualify all of this by saying that it isn't just .NET that behaves in this way. The most recent version of Java that I used in anger (1.4.2) also behaves like this: no stack trace from OutOfMemoryError. Now admittedly I want to have my cake and eat it, but how useful would it be if the JVM and CLR provided this information, even if it was only a partial stack trace from the point where the exception/error occurred back up through a few stack frames? I think that would be very cool indeed, although somehow the VMs in question would need to reserve enough memory to pull off this little trick, and it could well be a complete pain to implement, and, well you get the picture... but in an ideal world, how cool would it be?

Anyway, "You may say that I'm a dreamer..." ;-)

That's all for now. The new version of DTS Package Compare (formerly DTS Compare) is coming along a treat so I'm going to get back to it. Watch this space.

by Bart Read
Filed Under:

Comments

No Comments
You need to sign in to comment on this blog

About Bart Read

Bart has done many things since he started work at Red Gate Software Ltd in August 2004, but nowadays he's (mainly) the product manager for the .NET Developer Tools. He still feels like this is a bit like admitting you were cheering for the Empire whilst watching Star Wars, but for now he's along for the ride. In a previous incarnation he was a project manager leading the .NET Reflector Pro, ANTS Memory Profiler 5, ANTS Performance Profiler 4 & 5, and SQL Prompt 3.0 - 3.6 projects. He still occasionally writes some code and, in the past, has touched the code for most of the Red Gate SQL developer tools... some of them still haven't recovered from the shock. He was born and grew up in Dorset, was educated in Nottingham and London, and likes music and real ale. His photo is extremely misleading.
Latest articles
Backups, What Are They Good For?
 We've heard the confessional story from Pixar that Toy Story 2 was almost lost due to a bad backup, but... Read more...

C# Async: What is it, and how does it work?
 The biggest new feature in C#5 is Async, and its associated Await (contextual) keyword. Anybody who is... Read more...

Handling Deadlocks in SQL Server
 In this excerpt from his book Troubleshooting SQL Server: A Guide for the Accidental DBA, Jonathan... Read more...

SQL VIEW Basics
 SQL Views are essential for the database developer. However, it is common to see them misued, or... Read more...

The PoSh DBA: Grown-Up PowerShell Functions
 Laerte goes step-by-step through the process of tidying up and making more reusable an untidy... Read more...