love to code .net

blogging mostly about one of my favorite subjects, programming

CSLA.NET Memory Leak

Background

There is a related post here on the CSLA.NET Forums.  The forum doesn’t allow images.  The Ants Memory Profiler screen captures may be useful so they are in this post.  A bunch of images would just look weird, so this post contains more detail.

While writing a replacement application for an Access DB I wrote about 10 years ago for a client, I discovered a memory leak when importing data from the access source.  The application is not just a replacement but an upgrade to both the DB and the Business Logic.  It’s now a ASP.NET MVC based using CSLA.NET with a SQL DB.  The DB import isn’t just copying the tables over directly; the entire table structure has been changed.  To limit the amount of dedicated code, the import uses the CSLA Business Objects.

During development a situation occurred where remote users of the Access application weren’t able to consistently use it, and eventually not at all.  So that meant a slight refocus on the development effort to get the portion that they use up an running.  Unfortunately when I tried to import the full database, the application crashed several hours into the import due to a OutOfMemoryException.  This was two weeks into what I estimated to be a three week effort.  The next five days were spent finding where the memory was leaking.  It probably would have gone faster if I had just gotten Ants Profiler from the start, but I was convinced it had to be something I was doing in my Business Objects and thought I could use the memory profiler built into Visual Studio 2008.

More...

VSLive! 2008 Las Vegas

Next week I'm attending VSLive! 2008 in Las Vegas at the Mirage.  I attended last year's conference at the Rio All Suites Hotel & Casino and thought it was excellent.  I am looking forward to another excellent conference this year.  I'll be attending the pre and post conference workshops as well, as I found them tremendously valuable last year.  I will be taking a couple junior programmers along with me this year.  In addition to my team, there will be three more from other teams within my organization attending.