Results 1 to 13 of 13
  1. #1
    Join Date
    Jan 2002
    Location
    Chennai, India
    Posts
    10

    Unanswered: Memory Leak in Jet OLEDB 4.0

    I found some interesting & shocking thing about Microsoft Jet OLEDB 4.0 Engine.

    My Application is written with MFC/ADO/Access 2000. Initially it starts with 6 MB and the application memory shoots up to 140 MB eating all the virtual memory in the system, crashing the applciation. I didn't find any possible memory leaks in my application.

    I found these two articles in MSDN :

    Memory Use Climbs with Multiple Recordsets Under a Single Jet Session/Connection (Q247140):
    As per the status in the article, the problem has been fixed with Jet4.0 Service Pack 6.
    But i tried with Jet4Sp6, but still no improvement and also i tried with mutilple connection, but no improvement.

    PRB: Jet OLE DB Provider Consuming Too Much Memory (Q248014):
    As per the resolution in the article, i tried with setting Jet OLEDB:Max Buffer Size=2048, but still i didn't get any improvement.

    It seems that this problem has still not been solved by Microsoft.

    If anybody has come across this problem, Could you please share your views??

  2. #2
    Join Date
    Mar 2002
    Location
    Westfield, NJ, USA
    Posts
    23

    Access memory leaks

    I have seen it big time!
    As a matter of fact EVERY single time on a extensive read of a large text file (going on for several days), with lots of Mid Function usage (like 30-40 times per record with some 10 mil. records) - Ram would get "eaten up" from initial almost 1 GB to zero and PC would crash as a result.

    If I stopped it before (say when there was few MB of available RAM) and closed Access (2002!) available RAM would return to normal of available 950 MB or so.
    Under W.NT/2000/XP Task Manager can be used to monitor RAM usage. For 95/98 (also for NT/2000/XP) an excellent tiny piece of free software from
    http://www.jfitz.com/RAMpage/index.html
    could be employed.

  3. #3
    Join Date
    Apr 2002
    Location
    Germany
    Posts
    228
    Try to explicitally close your ADO objects and set the references to nothing (or null in the mfc case) as soon as they're not needed anymore. That might help to reduce the memory leakage.

  4. #4
    Join Date
    Mar 2002
    Location
    Westfield, NJ, USA
    Posts
    23

    No effect

    I do.

    At the end of each read/ Mid(...,...) /updateRS loop I have:

    If RecordsWritten = 500000 Then
    RawRS_In.Close
    Set RawRS_In = Nothing
    Set RawRS_In = CurrentDb.OpenRecordset("dbo_Inbound")
    End If
    If RecordsWritten = 1000000 Then
    RawRS_In.Close
    Set RawRS_In = Nothing
    Set RawRS_In = CurrentDb.OpenRecordset("dbo_Inbound")
    End If

    ...and so on, some dozen times.
    Available RAM will still diminish at the rate of 100-200 MB/day, Access will crash anyway, report sent to Micro$oft and that’s that.

    Perhaps if I do it more often (close RS, do cleanup and such) will my Access 2002 soar plane with leaking jet engine fly further?

  5. #5
    Join Date
    Mar 2002
    Location
    Westfield, NJ, USA
    Posts
    23

    Throw in few more $$ for more RAM?

    palaniappababu,

    How much RAM do you have? How much temp space (free space) on C: drivie?
    If - unlike in my case - your Access app. DOES NOT have to run for days to do what it needs to do - set it to "compact on exit". It is quite normal for Access to grow with usage since for instance: deleted record is still a record.
    Important question is: "how much is too much"?

  6. #6
    Join Date
    Jan 2002
    Location
    Chennai, India
    Posts
    10
    My RAM Size is 256MB and Free Hard Disk Space when i started should be around 500 MB.

    I use a fresh database, everytime i restart the application.

    I tried resetting the parent connection object frequently and made it to null. But still it didn't workout.

    The same code was working in DAO/Access97 without any problem.

    Regards,
    Babu

  7. #7
    Join Date
    Mar 2002
    Location
    Westfield, NJ, USA
    Posts
    23

    Is it a common problem?


  8. #8
    Join Date
    Apr 2002
    Location
    Germany
    Posts
    228

    Re: No effect

    Originally posted by Mirko
    I do.

    At the end of each read/ Mid(...,...) /updateRS loop I have:

    If RecordsWritten = 500000 Then
    RawRS_In.Close
    Set RawRS_In = Nothing
    Set RawRS_In = CurrentDb.OpenRecordset("dbo_Inbound")
    End If
    If RecordsWritten = 1000000 Then
    RawRS_In.Close
    Set RawRS_In = Nothing
    Set RawRS_In = CurrentDb.OpenRecordset("dbo_Inbound")
    End If
    Try not to use the CurrentDb. Do a set MyDb = CurrentDb once outside your loop and just reference MyDb.

  9. #9
    Join Date
    Jan 2002
    Location
    Chennai, India
    Posts
    10

    No Effect

    Hi Apel,

    I didn't find any improvement by closing the connection and making it to null.

    For Ex.. If the App. Memory is 28MB, after closing and repopening doen't frees any application memory and again the app. memory climbs up from 28MB to .....

  10. #10
    Join Date
    Jan 2002
    Location
    Chennai, India
    Posts
    10

    Will not help me

    Hi Mirko,

    Thanks for the Article [Memory Leak When Field in Recordset Has More Than 16K of Data (Q236574)]

    As per the status of this article (Q236574), the problem has been fixed in MDAC 2.5. But i am having MDAC 2.7 & Jet 4.0 SP6.

  11. #11
    Join Date
    Nov 2001
    Posts
    336
    Hi,

    1. Create new MDB file and import all the objects from your working MDB file.

    2. Create MDE file and try to run it. Any difference?

    Igor

  12. #12
    Join Date
    Jan 2002
    Location
    Chennai, India
    Posts
    10
    Hi Igor,

    I am inserting records from VC++/MFC application in to MS-Access 2000 database using ADO. The database is just used for Storing and Querying. No Forms/Reports objects are there in the MS-Access Database. So i think converting the MDB to MDE will not help in my situation.

  13. #13
    Join Date
    Dec 2002
    Posts
    29

    Red face Similar problem. Any solution came up?

    Hi everybody!

    Searching for "memory leaks" I got into your topic.
    My problem is similar. I am using Access 2002's ADP (that uses ADO for everything)... and I have a report that gathers data from 1 stored procedure and 3 views. The result is a huge amont of data, but this is not the problem (if tried separatelly, the resultset comes in less then 3 seconds).
    When Access starts formatting the report, memory usage increases, for example, from 80M to 500M (5 times increase) till the report gots ready in PreView. And this memory will be freed up only when I close Access, not when I close the report (as it should be).
    Then, beeing in preview, I push the "Last page" button on the page selector... it follows another 500M memory usage increase, than the maximum 1GB permitted is reached, and everything stops with the "Out of memory" message.

    I would like to know the solution of your problem, if any came up, to try it in my case.
    I have Win2000 operating system with SP3, that eliminates all of Microsoft's solutions for similar problems (MDAC 2.6, etc.)

    Best regards,
    Botond

Posting Permissions

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