extentreports-java icon indicating copy to clipboard operation
extentreports-java copied to clipboard

java.lang.OutOfMemoryError: Java heap space

Open chik145 opened this issue 3 years ago • 4 comments

Hi, Getting this error while parallel execution for cucumber with junit project. its coming at "flush()" function. kindly help to resolve this issue, as test is not getting added to report. max heap memory is set to 4 GB

Extent Report Version 5.0.9

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:448) at java.lang.StringBuffer.append(StringBuffer.java:270) at java.io.StringWriter.write(StringWriter.java:101) at freemarker.core.DollarVariable.accept(DollarVariable.java:70) at freemarker.core.Environment.visit(Environment.java:334) at freemarker.core.Environment.visit(Environment.java:340) at freemarker.core.Environment.visit(Environment.java:340) at freemarker.core.Environment.visit(Environment.java:376) at freemarker.core.Environment.invokeMacroOrFunctionCommonPart(Environment.java:876) at freemarker.core.Environment.invokeMacro(Environment.java:812) at freemarker.core.UnifiedCall.accept(UnifiedCall.java:84) at freemarker.core.Environment.visit(Environment.java:334) at freemarker.core.Environment.visit(Environment.java:376) at freemarker.core.IteratorBlock$IterationContext.executedNestedContentForCollOrSeqListing(IteratorBlock.java:321) at freemarker.core.IteratorBlock$IterationContext.executeNestedContent(IteratorBlock.java:271) at freemarker.core.IteratorBlock$IterationContext.accept(IteratorBlock.java:244) at freemarker.core.Environment.visitIteratorBlock(Environment.java:644) at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:108) at freemarker.core.IteratorBlock.accept(IteratorBlock.java:94) at freemarker.core.Environment.visit(Environment.java:370) at freemarker.core.Environment.invokeMacroOrFunctionCommonPart(Environment.java:876) at freemarker.core.Environment.invokeMacro(Environment.java:812) at freemarker.core.UnifiedCall.accept(UnifiedCall.java:84) at freemarker.core.Environment.visit(Environment.java:334) at freemarker.core.Environment.visit(Environment.java:376) at freemarker.core.IteratorBlock$IterationContext.executedNestedContentForCollOrSeqListing(IteratorBlock.java:321) at freemarker.core.IteratorBlock$IterationContext.executeNestedContent(IteratorBlock.java:271) at freemarker.core.IteratorBlock$IterationContext.accept(IteratorBlock.java:244) at freemarker.core.Environment.visitIteratorBlock(Environment.java:644)

chik145 avatar Dec 09 '21 09:12 chik145

@anshooarora Please Help Me On This

chik145 avatar Dec 10 '21 06:12 chik145

I am also facing the same issue. Did you find any workaround or solution?

sonugupta029 avatar Apr 10 '23 16:04 sonugupta029

I am facing this issue as well. Looks like each test is not independently created and attached at flush and is using shared memory with other tests in the report which is consuming more memory. Need to be refactored i guess.

krishtoautomate avatar Jun 04 '23 03:06 krishtoautomate