Re: Potential Memory Leak with DataSet ?

From: Cube (anonymous_at_discussions.microsoft.com)
Date: 05/27/04


Date: Thu, 27 May 2004 14:16:05 -0700

Thanks for the feedback,

To be honest my job is seriously on the line if I don't get this fixed and
it's getting me down :o( Any help is hugely welcome.

Some more info. on my problem ...

1. User Clicks Login and is Validated against database (username/pwd using SQLSelectCommand)
2. InitialiseApplication() is called which launches a worker thread that loads the
   database into dataset (about 16,000 records), while the UI thread updates
   a progress bar. Worked Thread sets a Global Boolean Flag to indicate when
   it's finished, progress bar stops. Takes about 30 seconds.
3. RefreshDetails() is called which binds list boxes, etc.to the tables in the dataset.
   The layout of my app is several panels containing these controls with show/hide
   being used.

4. Person collects information moving from location to location. For each item the
    user selects a record is inserted/updated in the appropriate table in the dataset.

5. On a periodic basis which does vary (some may do it twice a day, others once a
   week) a synchronisation takes place. The database is updated from the dataset.
   Once the database is updated, a connection is established to the SQL Server using
   GPRS, all the ususal Merge Replication activity occurs and no conflicts are reported.
   After the Sync a Worked Thread is created to load the database back up into
   the dataset, while the UI thread updates a progress bar. The Worked Thread sets
   a Global boolean to indicate this it's finished. User Controls are rebound as in step 3.

Problem...
I can't reproduce the error I'm getting consistenly as it seems to happen sporadically
and usually over a period of time. When the error does happen it seems that:
- Some of the data is not making it from the dataset to the CE database.
- When a sync occurs most of my user controls do not contain any items.

Question...
1. Is my use of threads messing things up? Maybe the dataset is being accessed by
different threads and that's screwing things up?
2. Is my dataset too large - 16,000 records (2MB) ?
3. Is my dataset being held in memory too long? User *closes* app (i.e. clicks on
X), which we know doesn't close it in the traditional sense, and opens it 2-3 days
later, before syncing. Maybe this ties in with Q1?
4. I came across this issue on MS KB and can confirm that I don't explicity call Dispose()
will it affect me? http://www.kbalertz.com/Feedback_824462.aspx

Any help is hugely appreciated.



Relevant Pages

  • Re: Compile, Crash, Scream
    ... DataTime picker and progress bar controls from your application ... contain the controls mentioned. ... objects from the MDB file into a new, blank database might help. ...
    (microsoft.public.access.formscoding)
  • Re: Nice if I can cosmetic changes (Access 2000)
    ... I would like if its possible to add two cosmetic changes. ... When the switchboard first appears, ... Finally...and not a cosmetic change...my database uses a function to ... the progress bar has reached the end which is when the reports should ...
    (microsoft.public.access.modulesdaovba)
  • Re: Potential Memory Leak with DataSet ?
    ... InitialiseApplicationis called which launches a worker thread that loads the> database into dataset, while the UI thread updates> a progress bar. ... User Controls are rebound as in step 3. ... if you were eating an exception then it could certianly mask whatever is happening. ... He wrote a killer book on SQL Server CE and the Compact Framework and has done quite a bit with it. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Animated AVIs?
    ... > progress bar when data is being inserted into the database. ... > Does anyone know where I can get AVIs that I can use with VB6? ... > for spinning gears or a icon of a PC communicating with a database. ... There's a control specifically for this included with VB Pro and Ent ...
    (microsoft.public.vb.database.ado)
  • Re: Processing or wait control
    ... Is there a processing or wait control in .NET that i can display to the user when large amounts of data are loaded from the database. ... Since i cant use the progress bar since i dont know how much data is loaded from the database. ... The other option would be to make a call to the DB to get the number of records, then use a datareader to load the data from the database. ... This way you can incriment the progress bar in your datareader loop and it will be acturate. ...
    (microsoft.public.dotnet.languages.csharp)