Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-7702

Export of large files fails on Java 11 with OutOfMemoryError

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Neutral
    • Resolution: Fixed
    • Affects Version/s: 6.2
    • Fix Version/s: 5.7.6, 6.1.5, 6.2
    • Component/s: None
    • Labels:
    • Sprint:
      SPA Editor 13, SPA Editor 14
    • Story Points:
      1

      Description

      Export of large files fails on systems with Java 11 with following exception:

      2020-01-06 13:43:35,674 ERROR nfo.magnolia.admincentral.AdmincentralErrorHandler: AdmincentralUI has encountered an unhandled exception.
      com.vaadin.server.ServerRpcManager$RpcInvocationException: Unable to invoke method onActionTriggered in info.magnolia.ui.vaadin.gwt.client.actionbar.rpc.ActionbarServerRpc
      	at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:159) ~[vaadin-server-8.8.5.jar:8.8.5]
      	at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:116) ~[vaadin-server-8.8.5.jar:8.8.5]
      	at com.vaadin.server.communication.ServerRpcHandler.handleInvocation(ServerRpcHandler.java:445) [vaadin-server-8.8.5.jar:8.8.5]
      	at com.vaadin.server.communication.ServerRpcHandler.handleInvocations(ServerRpcHandler.java:410) [vaadin-server-8.8.5.jar:8.8.5]
      	at com.vaadin.server.communication.ServerRpcHandler.handleRpc(ServerRpcHandler.java:274) [vaadin-server-8.8.5.jar:8.8.5]
      	at com.vaadin.server.communication.UidlRequestHandler.synchronizedHandleRequest(UidlRequestHandler.java:90) [vaadin-server-8.8.5.jar:8.8.5]
      	at com.vaadin.server.SynchronizedRequestHandler.handleRequest(SynchronizedRequestHandler.java:40) [vaadin-server-8.8.5.jar:8.8.5]
      	at com.vaadin.server.VaadinService.handleRequest(VaadinService.java:1602) [vaadin-server-8.8.5.jar:8.8.5]
      	at com.vaadin.server.VaadinServlet.service(VaadinServlet.java:445) [vaadin-server-8.8.5.jar:8.8.5]
      	at info.magnolia.admincentral.AdmincentralServlet.service(AdmincentralServlet.java:114) [magnolia-admincentral-6.1.3.jar:?]
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) [servlet-api.jar:?]
      	at info.magnolia.cms.filters.ServletDispatchingFilter.doFilter(ServletDispatchingFilter.java:148) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:81) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:81) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:81) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:81) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:81) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.CompositeFilter.doFilter(CompositeFilter.java:65) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.virtualuri.VirtualUriFilter.doFilter(VirtualUriFilter.java:98) [magnolia-virtual-uri-6.1.3.jar:?]
      	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.module.cache.executor.Bypass.processCacheRequest(Bypass.java:58) [magnolia-cache-core-5.8.1.jar:?]
      	at info.magnolia.module.cache.executor.CompositeExecutor.processCacheRequest(CompositeExecutor.java:66) [magnolia-cache-core-5.8.1.jar:?]
      	at info.magnolia.module.cache.filter.CacheFilter.doFilter(CacheFilter.java:164) [magnolia-cache-core-5.8.1.jar:?]
      	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.i18n.I18nContentSupportFilter.doFilter(I18nContentSupportFilter.java:85) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.RangeSupportFilter.doFilter(RangeSupportFilter.java:78) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:81) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.security.BaseSecurityFilter.doFilter(BaseSecurityFilter.java:57) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:81) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.security.SecurityCallbackFilter.doFilter(SecurityCallbackFilter.java:84) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:59) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.security.LogoutFilter.doFilter(LogoutFilter.java:94) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:59) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.module.site.filters.SiteMergeFilter.doFilter(SiteMergeFilter.java:119) [magnolia-site-1.2.3.jar:?]
      	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MultiChannelFilter.doFilter(MultiChannelFilter.java:83) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.module.cache.filter.GZipFilter.doFilter(GZipFilter.java:74) [magnolia-cache-core-5.8.1.jar:?]
      	at info.magnolia.cms.filters.OncePerRequestAbstractMgnlFilter.doFilter(OncePerRequestAbstractMgnlFilter.java:59) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:81) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.security.auth.login.LoginFilter.doFilter(LoginFilter.java:127) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:81) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:81) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:81) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.ContentTypeFilter.doFilter(ContentTypeFilter.java:155) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.ContextFilter.doFilter(ContextFilter.java:128) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MgnlFilterChain.doFilter(MgnlFilterChain.java:79) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.CompositeFilter.doFilter(CompositeFilter.java:65) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.AbstractMgnlFilter.doFilter(AbstractMgnlFilter.java:85) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.SafeDestroyMgnlFilterWrapper.doFilter(SafeDestroyMgnlFilterWrapper.java:107) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MgnlFilterDispatcher.doDispatch(MgnlFilterDispatcher.java:67) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MgnlMainFilter.doFilter(MgnlMainFilter.java:110) [magnolia-core-6.1.3.jar:?]
      	at info.magnolia.cms.filters.MgnlMainFilter.doFilter(MgnlMainFilter.java:96) [magnolia-core-6.1.3.jar:?]
      	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [catalina.jar:9.0.10]
      	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [catalina.jar:9.0.10]
      	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) [catalina.jar:9.0.10]
      	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [catalina.jar:9.0.10]
      	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491) [catalina.jar:9.0.10]
      	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [catalina.jar:9.0.10]
      	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [catalina.jar:9.0.10]
      	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668) [catalina.jar:9.0.10]
      	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [catalina.jar:9.0.10]
      	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [catalina.jar:9.0.10]
      	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) [tomcat-coyote.jar:9.0.10]
      	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-coyote.jar:9.0.10]
      	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:764) [tomcat-coyote.jar:9.0.10]
      	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1388) [tomcat-coyote.jar:9.0.10]
      	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-coyote.jar:9.0.10]
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
      	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-util.jar:9.0.10]
      	at java.lang.Thread.run(Thread.java:834) [?:?]
      Caused by: java.lang.reflect.InvocationTargetException
      	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
      	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
      	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
      	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
      	at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:155) ~[vaadin-server-8.8.5.jar:8.8.5]
      	... 93 more
      Caused by: com.vaadin.event.ListenerMethod$MethodException: Invocation of method actionTrigger in info.magnolia.ui.actionbar.ActionbarViewImpl$1 failed.
      	at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:519) ~[vaadin-server-8.8.5.jar:8.8.5]
      	at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:273) ~[vaadin-server-8.8.5.jar:8.8.5]
      	at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:237) ~[vaadin-server-8.8.5.jar:8.8.5]
      	at com.vaadin.server.AbstractClientConnector.fireEvent(AbstractClientConnector.java:1014) ~[vaadin-server-8.8.5.jar:8.8.5]
      	at info.magnolia.ui.vaadin.actionbar.Actionbar.access$000(Actionbar.java:59) ~[magnolia-ui-vaadin-common-widgets-6.1.3.jar:6.1.3]
      	at info.magnolia.ui.vaadin.actionbar.Actionbar$1.onActionTriggered(Actionbar.java:71) ~[magnolia-ui-vaadin-common-widgets-6.1.3.jar:6.1.3]
      	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
      	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
      	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
      	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
      	at com.vaadin.server.ServerRpcManager.applyInvocation(ServerRpcManager.java:155) ~[vaadin-server-8.8.5.jar:8.8.5]
      	... 93 more
      Caused by: java.lang.OutOfMemoryError: Java heap space
      	at com.sun.org.apache.xml.internal.serializer.ToStream$CharacterBuffer.addText(ToStream.java:3431) ~[?:?]
      	at com.sun.org.apache.xml.internal.serializer.ToStream.characters(ToStream.java:1417) ~[?:?]
      	at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerHandlerImpl.characters(TransformerHandlerImpl.java:175) ~[?:?]
      	at org.xml.sax.helpers.XMLFilterImpl.characters(XMLFilterImpl.java:588) ~[?:?]
      	at org.apache.jackrabbit.commons.xml.Exporter.characters(Exporter.java:387) ~[jackrabbit-jcr-commons-2.18.1.jar:?]
      	at org.apache.jackrabbit.commons.xml.SystemViewExporter$1.write(SystemViewExporter.java:133) ~[jackrabbit-jcr-commons-2.18.1.jar:?]
      	at org.apache.jackrabbit.util.Base64.encode(Base64.java:211) ~[jackrabbit-jcr-commons-2.18.1.jar:?]
      	at org.apache.jackrabbit.util.Base64.encode(Base64.java:158) ~[jackrabbit-jcr-commons-2.18.1.jar:?]
      	at org.apache.jackrabbit.value.ValueHelper.serialize(ValueHelper.java:738) ~[jackrabbit-jcr-commons-2.18.1.jar:?]
      	at org.apache.jackrabbit.commons.xml.SystemViewExporter.exportValue(SystemViewExporter.java:129) ~[jackrabbit-jcr-commons-2.18.1.jar:?]
      	at org.apache.jackrabbit.commons.xml.SystemViewExporter.exportProperty(SystemViewExporter.java:92) ~[jackrabbit-jcr-commons-2.18.1.jar:?]
      	at org.apache.jackrabbit.commons.xml.Exporter.exportProperty(Exporter.java:362) ~[jackrabbit-jcr-commons-2.18.1.jar:?]
      	at org.apache.jackrabbit.commons.xml.Exporter.exportProperties(Exporter.java:267) ~[jackrabbit-jcr-commons-2.18.1.jar:?]
      	at org.apache.jackrabbit.commons.xml.SystemViewExporter.exportNode(SystemViewExporter.java:77) ~[jackrabbit-jcr-commons-2.18.1.jar:?]
      	at org.apache.jackrabbit.commons.xml.Exporter.exportNode(Exporter.java:296) ~[jackrabbit-jcr-commons-2.18.1.jar:?]
      	at org.apache.jackrabbit.commons.xml.Exporter.exportNodes(Exporter.java:213) ~[jackrabbit-jcr-commons-2.18.1.jar:?]
      	at org.apache.jackrabbit.commons.xml.SystemViewExporter.exportNode(SystemViewExporter.java:78) ~[jackrabbit-jcr-commons-2.18.1.jar:?]
      	at org.apache.jackrabbit.commons.xml.Exporter.exportNode(Exporter.java:293) ~[jackrabbit-jcr-commons-2.18.1.jar:?]
      	at org.apache.jackrabbit.commons.xml.Exporter.export(Exporter.java:143) ~[jackrabbit-jcr-commons-2.18.1.jar:?]
      	at info.magnolia.importexport.command.JcrExportCommand.execute(JcrExportCommand.java:115) ~[magnolia-core-6.1.3.jar:?]
      	at info.magnolia.commands.MgnlCommand.executeSynchronized(MgnlCommand.java:80) ~[magnolia-core-6.1.3.jar:?]
      	at info.magnolia.commands.MgnlCommand.execute(MgnlCommand.java:69) ~[magnolia-core-6.1.3.jar:?]
      	at info.magnolia.commands.CommandsManager.executeCommand(CommandsManager.java:257) ~[magnolia-core-6.1.3.jar:?]
      	at info.magnolia.commands.CommandsManager.executeCommand(CommandsManager.java:245) ~[magnolia-core-6.1.3.jar:?]
      	at info.magnolia.ui.framework.action.AbstractCommandAction.executeOnItem(AbstractCommandAction.java:201) ~[magnolia-ui-framework-compatibility-6.1.3.jar:?]
      	at info.magnolia.ui.framework.action.AbstractMultiItemAction.execute(AbstractMultiItemAction.java:107) ~[magnolia-ui-framework-compatibility-6.1.3.jar:?]
      	at info.magnolia.ui.api.action.AbstractActionExecutor.execute(AbstractActionExecutor.java:62) ~[magnolia-ui-api-6.1.3.jar:?]
      	at info.magnolia.ui.contentapp.browser.BrowserPresenter.executeAction(BrowserPresenter.java:311) ~[magnolia-ui-framework-compatibility-6.1.3.jar:?]
      	at info.magnolia.ui.contentapp.browser.BrowserPresenter.onActionbarItemClicked(BrowserPresenter.java:270) ~[magnolia-ui-framework-compatibility-6.1.3.jar:?]
      	at info.magnolia.ui.actionbar.ActionbarPresenter.onActionbarItemClicked(ActionbarPresenter.java:208) ~[magnolia-ui-framework-compatibility-6.1.3.jar:?]
      	at info.magnolia.ui.actionbar.ActionbarViewImpl$1.actionTrigger(ActionbarViewImpl.java:70) ~[magnolia-ui-framework-compatibility-6.1.3.jar:?]
      	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
      

      It is caused by implementation difference in the com.sun.org.apache.xml.internal.serializer.ToStream.

      On Java 8, the aforementioned class flushes byte buffer after each 16KB data read.

      While in Java 11, the implementation changed quite a lot. Characters are now stored in a list of ToStream.CharacterBuffer.GenericCharacters objects and are flushed immediately if OutputKeys.INDENT is set to no.
      If OutputKeys.INDENT is se to yes, then all data that should be indented are stored in in the list of GenericCharacters objects, thus producing the OOME for large binaries.

      OOME can be avoided, if we disable pretty print for large files - so we could introduce new flag that could control pretty print.

        Checklists

        Acceptance criteria

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                jsimak Jaroslav Simak
                Reporter:
                jsimak Jaroslav Simak
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    Checklists

                    Bug DoR
                    DoD