Results 1 to 3 of 3

Thread: SQL CE Takes too much Memory

  1. #1

    Thread Starter
    Addicted Member Dmyze's Avatar
    Join Date
    Mar 2002
    Location
    Seattle
    Posts
    160

    SQL CE Takes too much Memory

    I have an MC 1000. At first I thought it was perfect, ultra low cost, and no extra features that were never used. At first they run perfectly, but after you insert a few hundred records into its CE Database it starts running slower and slower until it is almost unusable. I have the users reboot the device and it runs fine again for a while but does the same thing again. All my code is doing is adding records to the SQL CE DB.

    Anyone have similar problems? I am thinking of switching over to a XML file instead of SQL CE.

    I have converted as much storage memory into program memory and it has helped, but only for a while.
    Last edited by Dmyze; Oct 26th, 2005 at 11:40 AM.
    -Daryl
    "Two More Rolls of Duct tape, and the world is mine!"
    VB.NET Guru

  2. #2

    Thread Starter
    Addicted Member Dmyze's Avatar
    Join Date
    Mar 2002
    Location
    Seattle
    Posts
    160

    Re: SQL CE Takes too much Memory

    Glory of Glories.

    I came across the following MS Article while researching this problem:

    http://support.microsoft.com/?kbid=842191

    It mentions:

    Q17: Does setting my ADO Recordset to 'nothing' reclaim any memory?

    A17: Generally, the answer is "yes." However, Microsoft recommds that all your applications use set rs=nothing and set cn=nothing when you are finished using them. Database engines can take a fair amount of memory, and it is best not to leak memory.

    Usually, Microsoft Visual Basic eventually releases the memory. However, there have been some cases where the memory is not released quickly enough and you can run out of memory on the device, especially if you have a particularly bad memory leak.

    Made me think: am I setting all my objects to nothing? I went through my code and found that although I was setting all my Connections = Nothing I wasn't setting the SqlCeCommand Objects to nothing when I was done with them. I added a few cmd = Nothing lines and now my App runs Faster then ever and doesn't seem to be stopping for anything.

    Whoo!
    -Daryl
    "Two More Rolls of Duct tape, and the world is mine!"
    VB.NET Guru

  3. #3
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: SQL CE Takes too much Memory

    That's good to know.
    My usual boring signature: Nothing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width