appreciated / vaadin-app-layout

<app-layout> integration for Vaadin 8.1+, 10+ and 14+
Apache License 2.0
83 stars 44 forks source link

IllegalArgumentException / OutOfMemoryError #316

Open pbaris opened 4 years ago

pbaris commented 4 years ago

There was an exception while trying to navigate to '' with the exception message 'Unable to create an instance of 'com.github.appreciated.IronCollapseLayout'. The constructor threw an exception.'

java.lang.IllegalArgumentException: Unable to create an instance of 'com.github.appreciated.IronCollapseLayout'. The constructor threw an exception.
    at com.vaadin.flow.internal.ReflectTools.createProxyInstance(ReflectTools.java:512)
    at com.vaadin.flow.internal.ReflectTools.createInstance(ReflectTools.java:449)
    at com.vaadin.flow.component.Composite.initContent(Composite.java:77)
    at com.vaadin.flow.component.Composite.getContent(Composite.java:116)
    at com.github.appreciated.app.layout.component.menu.left.LeftSubmenu.<init>(LeftSubmenu.java:61)
    at com.github.appreciated.app.layout.component.menu.left.builder.LeftSubMenuBuilder.build(LeftSubMenuBuilder.java:65)

....

Caused by: java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOf(Arrays.java:3332)
    at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:124)
    at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:596)
    at java.lang.StringBuilder.append(StringBuilder.java:190)
    at org.apache.commons.io.output.StringBuilderWriter.write(StringBuilderWriter.java:143)
    at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:2370)
    at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:2348)
    at org.apache.commons.io.IOUtils.copy(IOUtils.java:2325)
    at org.apache.commons.io.IOUtils.copy(IOUtils.java:2273)
    at org.apache.commons.io.IOUtils.toString(IOUtils.java:1041)
    at com.vaadin.flow.server.frontend.FrontendUtils.getStatsContent(FrontendUtils.java:466)
    at com.vaadin.flow.component.polymertemplate.NpmTemplateParser.getSourcesFromStats(NpmTemplateParser.java:176)
    at com.vaadin.flow.component.polymertemplate.NpmTemplateParser.getTemplateContent(NpmTemplateParser.java:107)
    at com.vaadin.flow.component.polymertemplate.TemplateDataAnalyzer.parseTemplate(TemplateDataAnalyzer.java:200)
    at com.vaadin.flow.component.polymertemplate.TemplateInitializer.<init>(TemplateInitializer.java:91)
    at com.vaadin.flow.component.polymertemplate.PolymerTemplate.<init>(PolymerTemplate.java:88)
    at com.vaadin.flow.component.polymertemplate.PolymerTemplate.<init>(PolymerTemplate.java:103)
    at com.github.appreciated.IronCollapseLayout.<init>(IronCollapseLayout.java:25)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at com.vaadin.flow.internal.ReflectTools.createProxyInstance(ReflectTools.java:481)
    at com.vaadin.flow.internal.ReflectTools.createInstance(ReflectTools.java:449)
    at com.vaadin.flow.component.Composite.initContent(Composite.java:77)
    at com.vaadin.flow.component.Composite.getContent(Composite.java:116)
    at com.github.appreciated.app.layout.component.menu.left.LeftSubmenu.<init>(LeftSubmenu.java:61)
    at com.github.appreciated.app.layout.component.menu.left.builder.LeftSubMenuBuilder.build(LeftSubMenuBuilder.java:65)

i noticed it in both 4.0.0.rc4 and 4.0.0.rc5 versions

appreciated commented 4 years ago

Can you please give some more info about your environment, with logs only I cannot help you:

kunal-bhatia commented 4 years ago

I have had this issue as well where the app was throwing OutOfMemory error during runtime. For the same I increased the min and max heap size and with that it works just fine.

-Xms768M -Xmx768M