Memory Leaks in CSLA 1.53

Memory Leaks in CSLA 1.53

Old forum URL:

cf010 posted on Thursday, July 15, 2010

I'm working on a CSLA 1.53 system that suffers from a number of performance issues. Specifically it can't handle more than 20 concurrent users before overloading a reasonably new server. Using the ANTS Profiler has identified that CSLA objects are being held in memory indefinitely by the framework and CSLA extensions. It's a very bespoke and complicated implementation using Active Objects and Observer. Some of the 'business objects' have over 4000 lines of code so it's a real rabbit-warren.

Are performance issues common with the old version of CSLA? Google turns up pages and pages of search results from people with OutOfMemoryExceptions in CSLA, but not much in the way of a solution. Any advice appreciated.

RockfordLhotka replied on Thursday, July 15, 2010

You are using ActiveObjects right? I never looked at his code, but I think he includes an observer pattern implementation? It is really hard to get an observer pattern correct without causing memory leaks, and .NET 1.1 didn't have (iirc) any public API for creating weak references - which is the typical solution for that problem.

That is all speculation of course - but if you are using an observer of any sort, you'd have to be extremely careful to unsubscribe from the observer every time you subscribe or you'd create a memory leak.

Copyright (c) Marimer LLC