Geronimo
  1. Geronimo
  2. GERONIMO-4224

Outofmemory exception throwed by WebAccessLogViewer if the access log file size is too large, such as more than 200M

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.1
    • Fix Version/s: 2.1.3, 2.2
    • Component/s: console
    • Security Level: public (Regular issues)
    • Labels:
      None
    • Environment:

      HW: Intel x86 Core 2 Duo, 2G Memory
      SW: Linux

      Description

      Steps:
      1. put a large access log in var/catalina/logs
      2. start default server instance at port 8080
      3. login admin console
      4. filter access log including the timeframe the large access log spans

      Problem:
      Outofmemory exception thowed in the viewwebaccesslog portlet window. Instead of outofmemory exception throwed, suggest to either improve web access logging to split by size, or give a more friendly msg when log file size is too large. I would prefer the former one, because it will improve maintainability of geronimo in a long run environment.

      *************exception msg*****************
      Error rendering portlet.
      javax.portlet.PortletException
      at org.apache.pluto.core.DefaultPortletInvokerService.invoke(DefaultPortletInvokerService.java:191)
      at org.apache.pluto.core.DefaultPortletInvokerService.render(DefaultPortletInvokerService.java:101)
      at org.apache.pluto.core.PortletContainerImpl.doRender(PortletContainerImpl.java:173)
      at org.apache.pluto.driver.tags.PortletTag.doStartTag(PortletTag.java:152)
      at jsp.WEB_002dINF.themes.portlet_002dskin_jsp._jspService(portlet_002dskin_jsp.java:87)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
      at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
      at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
      at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
      at jsp.WEB_002dINF.themes.default_002dtheme_jsp._jspx_meth_c_005fforEach_005f0(default_002dtheme_jsp.java:196)
      at jsp.WEB_002dINF.themes.default_002dtheme_jsp._jspService(default_002dtheme_jsp.java:101)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
      at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
      at org.apache.pluto.driver.PortalDriverServlet.doGet(PortalDriverServlet.java:151)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:56)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
      at org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:406)
      at org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      at java.lang.Thread.run(Thread.java:810)
      Caused by: java.lang.OutOfMemoryError
      at java.nio.HeapCharBuffer.(HeapCharBuffer.java:54)
      at java.nio.CharBuffer.allocate(CharBuffer.java:327)
      at java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:688)
      at java.nio.charset.Charset.decode(Charset.java:802)
      at org.apache.geronimo.tomcat.TomcatLogManagerImpl.getMatchingItems(TomcatLogManagerImpl.java:200)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:618)
      at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
      at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
      at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:832)
      at org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java:57)
      at org.apache.geronimo.kernel.basic.RawOperationInvoker.invoke(RawOperationInvoker.java:35)
      at org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept(ProxyMethodInterceptor.java:96)
      at org.apache.geronimo.tomcat.TomcatLogManager$$EnhancerByCGLIB$$c6c65ce3.getMatchingItems()
      at org.apache.geronimo.console.logmanager.WebAccessLogViewerPortlet.doView(WebAccessLogViewerPortlet.java:253)
      at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:247)
      at javax.portlet.GenericPortlet.render(GenericPortlet.java:175)
      at org.apache.pluto.core.PortletServlet.dispatch(PortletServlet.java:208)
      at org.apache.pluto.core.PortletServlet.doGet(PortletServlet.java:139)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
      at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
      at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
      at org.apache.pluto.core.DefaultPortletInvokerService.invoke(DefaultPortletInvokerService.java:167)
      ... 42 more

      Nested Exception is java.lang.OutOfMemoryError
      at java.nio.HeapCharBuffer.(HeapCharBuffer.java:54)
      at java.nio.CharBuffer.allocate(CharBuffer.java:327)
      at java.nio.charset.CharsetDecoder.decode(CharsetDecoder.java:688)
      at java.nio.charset.Charset.decode(Charset.java:802)
      at org.apache.geronimo.tomcat.TomcatLogManagerImpl.getMatchingItems(TomcatLogManagerImpl.java:200)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:618)
      at org.apache.geronimo.gbean.runtime.ReflectionMethodInvoker.invoke(ReflectionMethodInvoker.java:34)
      at org.apache.geronimo.gbean.runtime.GBeanOperation.invoke(GBeanOperation.java:124)
      at org.apache.geronimo.gbean.runtime.GBeanInstance.invoke(GBeanInstance.java:832)
      at org.apache.geronimo.gbean.runtime.RawInvoker.invoke(RawInvoker.java:57)
      at org.apache.geronimo.kernel.basic.RawOperationInvoker.invoke(RawOperationInvoker.java:35)
      at org.apache.geronimo.kernel.basic.ProxyMethodInterceptor.intercept(ProxyMethodInterceptor.java:96)
      at org.apache.geronimo.tomcat.TomcatLogManager$$EnhancerByCGLIB$$c6c65ce3.getMatchingItems()
      at org.apache.geronimo.console.logmanager.WebAccessLogViewerPortlet.doView(WebAccessLogViewerPortlet.java:253)
      at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:247)
      at javax.portlet.GenericPortlet.render(GenericPortlet.java:175)
      at org.apache.pluto.core.PortletServlet.dispatch(PortletServlet.java:208)
      at org.apache.pluto.core.PortletServlet.doGet(PortletServlet.java:139)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
      at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
      at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
      at org.apache.pluto.core.DefaultPortletInvokerService.invoke(DefaultPortletInvokerService.java:167)
      at org.apache.pluto.core.DefaultPortletInvokerService.render(DefaultPortletInvokerService.java:101)
      at org.apache.pluto.core.PortletContainerImpl.doRender(PortletContainerImpl.java:173)
      at org.apache.pluto.driver.tags.PortletTag.doStartTag(PortletTag.java:152)
      at jsp.WEB_002dINF.themes.portlet_002dskin_jsp._jspService(portlet_002dskin_jsp.java:87)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
      at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:535)
      at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:472)
      at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
      at jsp.WEB_002dINF.themes.default_002dtheme_jsp._jspx_meth_c_005fforEach_005f0(default_002dtheme_jsp.java:196)
      at jsp.WEB_002dINF.themes.default_002dtheme_jsp._jspService(default_002dtheme_jsp.java:101)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)
      at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
      at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
      at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
      at org.apache.pluto.driver.PortalDriverServlet.doGet(PortalDriverServlet.java:151)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
      at org.apache.geronimo.tomcat.valve.DefaultSubjectValve.invoke(DefaultSubjectValve.java:56)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
      at org.apache.geronimo.tomcat.GeronimoStandardContext$SystemMethodValve.invoke(GeronimoStandardContext.java:406)
      at org.apache.geronimo.tomcat.valve.GeronimoBeforeAfterValve.invoke(GeronimoBeforeAfterValve.java:47)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      at java.lang.Thread.run(Thread.java:810)
      ***********************exception msg*****************************

        Activity

        Hide
        Jarek Gawor added a comment -

        It seems to me like the problem is in JettyLogManager/TomcatLogManager where it effectively attempts to read-in the entire log file into memory - that's even before parsing it.

        Show
        Jarek Gawor added a comment - It seems to me like the problem is in JettyLogManager/TomcatLogManager where it effectively attempts to read-in the entire log file into memory - that's even before parsing it.
        Hide
        Jarek Gawor added a comment -

        Changed the log manager code to read the log file line by line instead of loading the entire file into memory. Changes committed to trunk (revision 681419) and branches/2.1 (revision 681420).

        The problem was really with converting the mapped byte buffer into char byte buffer which allocates a new byte buffer in the heap.

        Show
        Jarek Gawor added a comment - Changed the log manager code to read the log file line by line instead of loading the entire file into memory. Changes committed to trunk (revision 681419) and branches/2.1 (revision 681420). The problem was really with converting the mapped byte buffer into char byte buffer which allocates a new byte buffer in the heap.
        Hide
        Jarek Gawor added a comment -

        Looks like the same problem applies to Derby log viewer and Server log viewer....

        Show
        Jarek Gawor added a comment - Looks like the same problem applies to Derby log viewer and Server log viewer....
        Hide
        Jarek Gawor added a comment -

        Committed similar fixes to trunk (revision 681472) and branches/2.1 (revision 681473) for Derby and Server log viewers.

        Show
        Jarek Gawor added a comment - Committed similar fixes to trunk (revision 681472) and branches/2.1 (revision 681473) for Derby and Server log viewers.

          People

          • Assignee:
            Jarek Gawor
            Reporter:
            Forrest Xia
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development