1 Reply Latest reply on Aug 7, 2005 4:26 PM by Frank Langelage

    unable to allocate xxx bytes of shared memory

    Ricardo Newbie

      Hi, I have the following error, when executing a findAll in a ejb CMP: the problem begin when I put the PK whit two fields (compose PK), if the PK only has one all is ok

      org.jboss.tm.JBossTransactionRolledbackException: Load failed; CausedByException is:
      ORA-04031: unable to allocate 232 bytes of shared memory ("shared pool","SELECT COD_MUNICIPIO, COD_RH...","sql area","logdef : apaclg")
      ; CausedByException is:
      Load failed; CausedByException is:
      ORA-04031: unable to allocate 232 bytes of shared memory ("shared pool","SELECT COD_MUNICIPIO, COD_RH...","sql area","logdef : apaclg")
      ; nested exception is:
      javax.ejb.EJBException: Load failed; CausedByException is:
      ORA-04031: unable to allocate 232 bytes of shared memory ("shared pool","SELECT COD_MUNICIPIO, COD_RH...","sql area","logdef : apaclg")
      ; - nested throwable: (javax.ejb.EJBException: Load failed; CausedByException is:
      ORA-04031: unable to allocate 232 bytes of shared memory ("shared pool","SELECT COD_MUNICIPIO, COD_RH...","sql area","logdef : apaclg")
      )
      org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:267)
      org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:196)
      org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
      org.jboss.ejb.Container.invoke(Container.java:870)
      sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      java.lang.reflect.Method.invoke(Method.java:324)
      org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:144)
      org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
      org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
      org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
      org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
      org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:155)
      org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:104)
      org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:115)
      org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:101)
      org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
      org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
      org.jboss.proxy.ejb.StatelessSessionInterceptor.invoke(StatelessSessionInterceptor.java:97)
      org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:91)
      $Proxy756.findAll(Unknown Source)
      co.gov.colciencias.cvlac.referencia.en_municipio.ejb.EnMunicipioSessionFacadeRemote.findAll(EnMunicipioSessionFacadeRemote.java:55)
      org.apache.jsp.jsp.popup.test_005fmunicipio_jsp._jspService(test_005fmunicipio_jsp.java:73)
      org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:39)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:75)



      the table has only 1000 rows, the log for the finder is

      SELECT COD_MUNICIPIO, COD_RH_MUNICIPIO, TXT_NME_MUNICIPIO, TXT_NME_MUNICIPIO_FILTRO, COD_MUNI_INTERNACIONAL, COD_MUNI_DANE, SGL_DEPARTAMENTO, SGL_PAIS FROM EN_MUNICIPIO WHERE (COD_MUNICIPIO=? AND COD_RH_MUNICIPIO=?) OR (COD_MUNICIPIO=? AND COD_RH_MUNICIPIO=?) ... etc

        • 1. Re: unable to allocate xxx bytes of shared memory
          Frank Langelage Master

          Your oracle configuration has to be changed to work with JBoss.

          04031, 00000, "unable to allocate %s bytes of shared memory (\"%s\",\"%s\",\"%s\",\"%s\")"
          // *Cause: More shared memory is needed than was allocated in the shared
          // pool.
          // *Action: If the shared pool is out of memory, either use the
          // dbms_shared_pool package to pin large packages,
          // reduce your use of shared memory, or increase the amount of
          // available shared memory by increasing the value of the
          // INIT.ORA parameters "shared_pool_reserved_size" and
          // "shared_pool_size".
          // If the large pool is out of memory, increase the INIT.ORA
          // parameter "large_pool_size".


          Or you may reduce the value for page-size from 1000 to 20 e.g. in $JBOSS_HOME/server/?/conf/standardjbosscmp-jdbc.xml:
          <read-ahead>
           <strategy>on-load</strategy>
           <page-size>20</page-size>
           <eager-load-group>*</eager-load-group>
           </read-ahead>