Announcement Announcement Module
Collapse
No announcement yet.
Hibernate Query Perfomance Issue Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Hibernate Query Perfomance Issue

    I am using Spring ORM Hibernate framework. The Hibernate Named Query returns 14,171 rows from the database table.

    My manager class in Spring makes a call to Hibernate Query and Right after the query is executed, the log shows it resulted in
    java.lang.OutOfMemoryError: Java heap space

    Not sure if its really memory issue or perfomance issue.

    Here is the log trace
    Code:
    Inside Manager
    Hibernate: 
        /* named HQL query findAddressBlockList */ select
            addressblo0_.ID as ID3_,
            addressblo0_.CHANGE_USER as CHANGE2_3_,
            addressblo0_.GATEWAY as GATEWAY3_,
            addressblo0_.AB_REGISTRY_ID as AB4_3_,
            addressblo0_.VPN_REG_ID as VPN5_3_,
            addressblo0_.NAMESPACE_ID as NAMESPACE6_3_,
            addressblo0_.DHCP_PARAM_ID as DHCP7_3_,
            addressblo0_.START_ADDR as START8_3_,
            addressblo0_.START_ADDR_PADDED as START9_3_,
            addressblo0_.END_ADDR as END10_3_,
            addressblo0_.MASK as MASK3_,
            addressblo0_.IP_VERSION as IP12_3_,
            addressblo0_.DESCRIPTION as DESCRIP13_3_,
            addressblo0_.COMMENTS as COMMENTS3_,
            addressblo0_.CHANGE_DOC as CHANGE15_3_,
            addressblo0_.VLAN as VLAN3_,
            addressblo0_.ANYCAST as ANYCAST3_,
            addressblo0_.WIRELESS as WIRELESS3_,
            addressblo0_.NETWORK_SEGMENT as NETWORK19_3_,
            addressblo0_.DHCP_ACTIVITY_DATE as DHCP20_3_,
            addressblo0_.DHCP_NET_MASK_OVERRIDE as DHCP21_3_,
            addressblo0_.SPING_AUDIT_DATE as SPING22_3_,
            addressblo0_.SPING_PROTECTED_DATE as SPING23_3_,
            addressblo0_.SPING_PROTECTED_BY as SPING24_3_,
            addressblo0_.DHCP_DEFAULT_DOMAIN as DHCP25_3_,
            addressblo0_.DHCP_CACHE_PERCENTAGE as DHCP26_3_,
            addressblo0_.DHCP_DNS_SUFFIX as DHCP27_3_,
            addressblo0_.STATUS as STATUS3_,
            addressblo0_.CHANGE_DATE as CHANGE29_3_ 
        from
            ADDRESS_BLOCK addressblo0_ 
        order by
            addressblo0_.START_ADDR
    Oct 25, 2007 10:27:38 AM com.sun.facelets.FaceletViewHandler handleRenderException
    SEVERE: Error Rendering View[/manageAddrBlkForm.xhtml]
    javax.faces.el.EvaluationException: /manageAddrBlkForm.xhtml @81,92 value="#{manageAddrBlkBean.addressBlockList}": Exception getting value of property addressBlockList of base of type : com.boeing.nmt.nams.view.bean.ManageAddrBlkBean
    	at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:60)
    	at javax.faces.component.UISelectItems.getValue(UISelectItems.java:58)
    	at org.apache.myfaces.shared_impl.util.SelectItemsIterator.hasNext(SelectItemsIterator.java:105)
    	at org.apache.myfaces.shared_impl.renderkit.RendererUtils.internalGetSelectItemList(RendererUtils.java:450)
    	at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getSelectItemList(RendererUtils.java:428)
    	at org.apache.myfaces.shared_impl.renderkit.html.HtmlRendererUtils.internalRenderSelect(HtmlRendererUtils.java:294)
    	at org.apache.myfaces.shared_impl.renderkit.html.HtmlRendererUtils.renderMenu(HtmlRendererUtils.java:267)
    	at org.apache.myfaces.shared_impl.renderkit.html.HtmlMenuRendererBase.encodeEnd(HtmlMenuRendererBase.java:59)
    	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:539)
    	at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:419)
    	at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.renderChildren(HtmlGridRendererBase.java:229)
    	at org.apache.myfaces.shared_impl.renderkit.html.HtmlGridRendererBase.encodeEnd(HtmlGridRendererBase.java:101)
    	at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:539)
    	at org.ajax4jsf.framework.renderer.RendererBase.renderChild(RendererBase.java:249)
    	at org.ajax4jsf.framework.renderer.RendererBase.renderChildren(RendererBase.java:225)
    	at org.ajax4jsf.renderers.ajax.AjaxOutputPanelRenderer.encodeChildren(AjaxOutputPanelRenderer.java:74)
    	at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:527)
    	at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:244)
    	at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
    	at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:249)
    	at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:573)
    	at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:101)
    	at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:222)
    	at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
    	at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
    	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    	at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    	at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:75)
    	at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:213)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    	at com.boeing.nmt.nams.view.util.SecurityFilter.doFilter(SecurityFilter.java:36)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    	at com.boeing.nmt.nams.view.util.MessageFilter.doFilter(MessageFilter.java:47)
    	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    	at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    	at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    	at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
    	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    	at java.lang.Thread.run(Thread.java:595)
    Caused by: javax.faces.el.EvaluationException: Bean: com.boeing.nmt.nams.view.bean.ManageAddrBlkBean, property: addressBlockList
    	at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:461)
    	at org.apache.myfaces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:85)
    	at org.apache.myfaces.custom.security.SecurityContextPropertyResolver.getValue(SecurityContextPropertyResolver.java:101)
    	at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:141)
    	at com.sun.el.parser.AstValue.getValue(AstValue.java:118)
    	at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:192)
    	at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
    	at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:56)
    	... 52 more
    Caused by: java.lang.reflect.InvocationTargetException
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    	at java.lang.reflect.Method.invoke(Method.java:585)
    	at org.apache.myfaces.el.PropertyResolverImpl.getProperty(PropertyResolverImpl.java:457)
    	... 59 more
    Caused by: java.lang.OutOfMemoryError: Java heap space
    Any pointers/suggestions highly appreciated

  • #2
    It's a memory issue...

    Creating 14.171 objects including there linked objects isn't a good idea.

    Comment


    • #3
      Hi Martein
      Thanks for quick response.
      I agree its memory issue at the same time i beileve its programming error because it works well very first time and subsequently accessing the page results in memory issue.
      Subsequent accessing of page calls JSF action method reset() which assigns the object to null. Even then it results in out of Memory.
      Not sure what i am doing wrong

      From the named query you will see i am not loading any linked objects

      Comment


      • #4
        Marten
        Forgot to ask what kind of debug parameter i need to set in log4j.properties file to see how & where exactly it results in out of memory issue. I know its happening on subsequent running of hibernate query

        Comment


        • #5
          RE: Hibernate Query Perfomance Issue Reply to Thread

          Are you keeping your hibernate session open between requests?

          Comment


          • #6
            I have configured hibernate session life cycle tied up with Transaction . What debug parameter i need to set in log4j.properties for example i wanna see why insert is not happening at hibernate level

            Comment

            Working...
            X