11 Replies Latest reply: Aug 22, 2008 1:07 PM by 628625 RSS

    OracleException:Memory could not be allocated

    628625
      Hi

      I am using Oracle Data Provider 10.2.0 for .NET 2.0 and have a problem.
      Had to make a test data generator which writes a lot of data to the database. After running for 14 hours I always get the following Exception:

      Type: Oracle.DataAccess.Client.OracleException
      Stack: Oracle.DataAccess.Client.OracleException.HandleErrorHelper(...)
      at Oracle.DataAccess.Client.OracleDataReader.read()
      at System.Data.Common.DataAdapter.FillLoadDataRow(DataSet dataset, ....)
      ...

      First I just thought that my application does not free the memory from previous inserted data but I could not find any evidence that the host is running out of memory. I regularely forced the GarbageCollector to collect and monitored the memory the GC is using and it did even not exceed a few MB. Does anyone have any clue what could cause this exception?

      Thanks
        • 1. Re: OracleException:Memory could not be allocated
          Lukecui
          Maybe we are on the same ship.
          Please check the dump file of oracle, and see if you have an error like
          Exception: Oracle.DataAccess.Client.OracleException
          Message: ORA-04030: out of process memory when trying to allocate 16396 bytes (QERHJ hash-joi,QERHJ Bit vector)
          ....
          • 2. Re: OracleException:Memory could not be allocated
            628625
            I have not checked yet.
            In which file did you have that error message?
            • 3. Re: OracleException:Memory could not be allocated
              502182
              Will it be possible for you to post sample code of your data generator to reproduce this error?

              Have you tried using latest ODP.NET 11g (11.1.0.6.20)?

              Your test data generator only inserts the data or it reads too? (as I see that the exception is coming from read.)
              • 4. Re: OracleException:Memory could not be allocated
                628625
                Unfortunately I am not able to post the sample code because the application is qute complex. I am using an OR-Mapper which ectually creates the insert statement for my objects.

                I have not used a new version of ODP.NET so fare. I hoped that someone else encountered the same problem and couild give me some advice. Now I am trying to reproduce the problem and check the trace file of Oracle if there is any information which would help me. Reproducing is not easy because I usually got this error after running my test data generator for at least 14 hours.
                • 5. Re: OracleException:Memory could not be allocated
                  628625
                  The Exception is comming for a data read

                  the stacktrace is
                  Type: Oracle.DataAccess.Client.OracleException
                  Stack: Oracle.DataAccess.Client.OracleException.HandleErrorHelper(...)
                  at Oracle.DataAccess.Client.OracleDataReader.read()
                  at System.Data.Common.DataAdapter.FillLoadDataRow(DataSet dataset, ....)
                  at System.Data.Common.DataAdapter.FillFromReader(...)
                  at System.Data.Common.DataAdapter.FillDataTable(...)
                  at System.Data.Common.DbDataAdapter.FillInternal(...)
                  at System.Data.Common.DbDataAdapter.Fill(...)
                  at System.Data.Common.DbDataAdapter.Fill(...)
                  at SD.LLBLGen.Pro.ORMSupportClasses

                  It comes from a data read, but only a OR-Mapper specific read. I am acturlly saving an object and the OR-Mapper saves the object and then reads it back to the memory to get the id of the primary key which is created by a sequence. The abount of data read is small so this can not case the error, but I am execuing the same method many thousand times before I finally get thet error
                  • 6. Re: OracleException:Memory could not be allocated
                    502182
                    Can you check if turning off statement caching helps? You may consult the user guide about statement caching.
                    • 7. Re: OracleException:Memory could not be allocated
                      628625
                      I have set statement chaching to 1 on the connection string but it did not help.
                      • 8. Re: OracleException:Memory could not be allocated
                        gdarling - oracle
                        A couple suggestions to help hone in on what's going on:

                        1) If you monitor both virtual bytes and private bytes using perfmon, does memory increase for one of the other the longer the app runs? If private bytes continually increase, thats a memorly leak, If virtual bytes increase but private bytes stay steady, thats fragmentation.

                        1a) Make sure you're calling dispose on everything you can.

                        2) You could take a memory hang dump using ADPlus, load sos.dll into windbg and then look at the heap using !dumpheap -stat
                        http://blogs.msdn.com/tess/archive/2008/02/15/net-debugging-demos-lab-3-memory.aspx

                        3) You could use DebugDiag to monitor the app memory usage.
                        http://www.microsoft.com/downloads/details.aspx?FamilyID=28bd5941-c458-46f1-b24d-f60151d875a3&displaylang=en
                        The nice thing about debugdiag is it will automatically generate a summary report that includes suggestions to troubleshot further


                        Hope it helps,
                        Greg
                        • 9. Re: OracleException:Memory could not be allocated
                          436784
                          We're seeing the same issue in our application as well. We're opening a ticket in Metalink for Oracle.
                          • 10. Re: OracleException:Memory could not be allocated
                            628625
                            I just thought to do the same.
                            Please let us know when you got a solution.
                            • 11. Re: OracleException:Memory could not be allocated
                              628625
                              Just to end this thread here. After installing the latest Oracle patch on my client machine (ODP.Net dlls changed from 10.2.0.2.20 to 10.2.0.3.3) the problem disappeared. It seems there was a memory leak with the 10.2.0.2.20 version.