3 Replies Latest reply on Oct 9, 2003 3:55 AM by frank_ulbricht

    OutOfMemory with finder method...

    frank_ulbricht

      Hello,

      I have to export a large number of enitity beans into a file (about 10.000) by a list of ids (primary keys). So I use the "findByPrimaryKey" method for each id and write the properties of the returned entity bean into the file. After that I do not need this bean any longer (hope the GC will care).

      After exporting the half of these beans I get an "OutOfMemory" exception. I tried to do it in a single transaction or with a transaction for every single bean. The result is the same.

      Increasing the VMs heap size could solve the problem. But what if I have to export much more beans?

      Anyone any idea? Thanks in advance...

      Frank.

        • 1. Re: OutOfMemory with finder method...
          dedalus71

          I have the same problem. I want to export 20000 customers in an XML file. If I do it with a single transaction I get a transaction time out, if I do it with a transaction for each customer I get an OutOfMemory.

          will anybody help me

          thanks in advance
          Lucio

          • 2. Re: OutOfMemory with finder method...
            nraghuram

            i guess if you reduce the read-ahead page size and the number of instances in entity cache you should overcome this problem. essentially, you should tell the container to cache fewer entities. i might be wrong, but you can try fiddling around with these settings
            raghu

            • 3. Re: OutOfMemory with finder method...
              frank_ulbricht

              I have solved the problem for now by providing more heap to the JVM. I guess the best solution would be a transaction for every single bean in combination with the commit option "C". But when I do so, some new error occur (locking problems). Somewhere I'v read, this problem is known with the commit option "C".