TableAdapters causing page file to go out of control RRS feed

  • Question

  • My application is a big loop.  It grabs information from various sources, performs heavy processing on it, then persists the results to a database.  The persistence is being accompished via table adapters.  Originally I had built all the persistence ino the 'Customer' object, of which there were between 60-100 at a time.  Each customer had 9 table adapters so it added up to quite a bit.  Due to the problem I will describe in the next paragraph, I changed the setup to remove the table adapters from the customer class and now have a CustomerPersister class that has the 9 table adapters as private statics and public static methods that are locked based on the customer object which is passed as a parameter.  All tableadapters are initialized only once via a static constructor.  I realize this may not be best practice etc but it works and it was relatively fast to develop so I am happy about that.

    With both approaches, however, I monitor my pagefile usage via the performance tab in the task manager and it grows until my computer effectively locks up or my application crashes.  I am running SQL server 2005 locally on a 3.2 ghz p4 with 1 gb of ram (weak system)

    I know my question lacks some details and I would be more than happy to provide more if needed.  I am wondering if this is due to SQL server caching or some kind of flaw in my design.  Note that when I comment out the code that triggers the persistence, My pagefile grows only a little bit initially and then stabilizes at a very reasonable size.

    update: this problem was caused by me using the Property Accessor found here: http://www.codeproject.com/csharp/fast_dynamic_properties.asp?df=100&forumid=165278&exp=0&select=1988746

    I switched back to using reflection which is slower but actually works.
    Friday, September 7, 2007 1:34 PM