5 Replies Latest reply on Jul 29, 2002 5:36 PM by jsimone

    Out-of-Memory Exception

      This occurs in Both 3.0.0 final and 3.0.1RC1. Each iteration creates a single CMP 2.0 entity bean and returns. Is this a known problem?


      [java] ------------------------------------------------------
      [java] --- CREATE SAMPLE EVENTS
      [java] --- Pass 1451 of 10000
      [java] --- Current Time: Sun Jul 28 18:14:18 EDT 2002
      [java] ------------------------------------------------------

      [java] java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
      [java] java.rmi.ServerException: null; nested exception is:
      [java] java.lang.OutOfMemoryError
      [java] Embedded Exception
      [java] null; nested exception is:
      [java] java.lang.OutOfMemoryError; nested exception is:
      [java] javax.ejb.TransactionRolledbackLocalException: null; nested exception is:
      [java] java.lang.OutOfMemoryError
      [java] Embedded Exception
      [java] null; nested exception is:
      [java] java.lang.OutOfMemoryError
      [java] java.rmi.ServerException: null; nested exception is:
      [java] java.lang.OutOfMemoryError
      [java] Embedded Exception
      [java] null; nested exception is:
      [java] java.lang.OutOfMemoryError; nested exception is:
      [java] javax.ejb.TransactionRolledbackLocalException: null; nested exception is:
      [java] java.lang.OutOfMemoryError
      [java] Embedded Exception
      [java] null; nested exception is:
      [java] java.lang.OutOfMemoryError
      [java] javax.ejb.TransactionRolledbackLocalException: null; nested exception is:
      [java] java.lang.OutOfMemoryError
      [java] Embedded Exception
      [java] null; nested exception is:
      [java] java.lang.OutOfMemoryError
      [java] at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:240)
      [java] at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:215)
      [java] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:117)
      [java] at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
      [java] at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:128)
      [java] at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:108)
      [java] at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:73)
      [java] at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:76)
      [java] at org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:111)
      [java] at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
      [java] at $Proxy1.createSampleEvents(Unknown Source)
      [java] at com.highnotes.ebu.client.test.Stress_2.main(Stress_2.java:91)
      [java] javax.transaction.TransactionRolledbackException: null; nested exception is:
      [java] java.lang.OutOfMemoryError
      [java] java.lang.OutOfMemoryError
      [java] <<no stack trace available>>



      Regards,
      joe

        • 1. Re: Out-of-Memory Exception

          Correction: Each iteration creates 10 CMP 2.0 entity beans. I just looked at the code again. So we get the memory exception after creating about 14,510 entities.

          An additional point is that if the entities are immediately removed after creation, NO memory exception occurs. In fact, I have had this test case running for almost 36 hours straight with no signs of distress.

          Below is the relevant code from the client and its result:


          int totalPasses = 10000;
          for (int pass=1; pass <= totalPasses; pass++) {
          // Create a bunch of sample data using the event manager interface ...
          messageBox("CREATE SAMPLE EVENTS", "Pass "+pass+" of "+totalPasses, " ");
          eventIds = eventManager.createSampleEvents(10);
          Iterator iter = eventIds.iterator();
          while (iter.hasNext()) {
          eventManager.removeEvent((String) iter.next());
          }
          }


          [java] ------------------------------------------------------
          [java] --- TEST COMPLETE
          [java] --- Pass 10000 of 10000, Total elapsed time: 0 days 0 hrs 26 mins 32 secs
          [java] --- Current Time: Sun Jul 28 18:53:08 EDT 2002
          [java] ------------------------------------------------------


          Kind regards,
          joe

          • 2. Re: Out-of-Memory Exception
            dsundstrom

            Are you attempting to create 15k entities in a single transaction? If you are the system has to keep all beans in memeory until the trasaction is comitted or rolledback. To solve this problem do the inserts in smaller chunks like 100 beans.

            • 3. Re: Out-of-Memory Exception

              Dain,

              Well, the session facade has "RequiresNew" as the transaction attribute and each of the entity bean methods has "Required".

              My expectation is that when the client invokes:

              eventIds = eventManager.createSampleEvents(10);

              that the createSampleEvents method of the eventManager Session bean WILL create a new transaction. Then, that 10 entity beans will be created under that transaction. Finally, when the createSampleEvents method returns to the client the transaction will be complete and a commit will be performed for the 10 enities created.

              I don't see any evidence of this happening.
              Shouldn't I be seeing SQL COMMITS in the server.log?

              Thanks for your help!

              regards,
              joe

              • 4. Re: Out-of-Memory Exception
                dsundstrom

                Yes that is what should be happening. I have used a similar setup in the past, and it worked for me. You sould try asking on the jboss-users mailing list or in one of the other forums (transactions are a JBoss server issue). If you think we have a bug, post a bug report at sourceforge.

                • 5. Re: Out-of-Memory Exception

                  OK, opened sourceForge bug

                  [ 588241 ] Out-of-memory Exception

                  The scenario is far too simple for such a thing to be happening. I suspect problems with the transaction management and commits not happening when they should.

                  How can I enable debug logging and see the commits being sent to the DB?

                  Just curious.
                  regards,
                  joe