You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. When I try to launch all my screenshot tests I'm get error:
java.lang.OutOfMemoryError: Java heap space
at java.desktop/java.awt.image.DataBufferInt.<init>(DataBufferInt.java:75)
at java.desktop/java.awt.image.Raster.createPackedRaster(Raster.java:539)
at java.desktop/java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1032)
at java.desktop/java.awt.image.BufferedImage.<init>(BufferedImage.java:333)
at com.github.takahirom.roborazzi.BitmapToBufferedImageConverter.convert(BitmapToBufferedImageConverter.kt:12)
at com.github.takahirom.roborazzi.AwtRoboCanvas$drawImage$1.invoke(AwtRoboCanvas.kt:49)
at com.github.takahirom.roborazzi.AwtRoboCanvas$drawImage$1.invoke(AwtRoboCanvas.kt:47)
at com.github.takahirom.roborazzi.AwtRoboCanvasKt.graphics(AwtRoboCanvas.kt:579)
at com.github.takahirom.roborazzi.AwtRoboCanvasKt.access$graphics(AwtRoboCanvas.kt:1)
at com.github.takahirom.roborazzi.AwtRoboCanvas.drawImage(AwtRoboCanvas.kt:47)
at com.github.takahirom.roborazzi.RoborazziKt.capture(Roborazzi.kt:621)
at com.github.takahirom.roborazzi.ImageCaptureViewAction.perform(Roborazzi.kt:587)
at androidx.test.espresso.ViewInteraction$SingleExecutionViewAction.perform(ViewInteraction.java:2)
at androidx.test.espresso.ViewInteraction.doPerform(ViewInteraction.java:25)
at androidx.test.espresso.ViewInteraction.-$$Nest$mdoPerform(ViewInteraction.java)
at androidx.test.espresso.ViewInteraction$1.call(ViewInteraction.java:7)
at androidx.test.espresso.ViewInteraction$1.call(ViewInteraction.java:1)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at android.os.Handler.$$robo$$android_os_Handler$handleCallback(Handler.java:942)
at java.base/java.lang.invoke.LambdaForm$DMH/0x00000008002e5800.invokeStatic(LambdaForm$DMH)
at java.base/java.lang.invoke.LambdaForm$MH/0x00000008002f2000.guardWithCatch(LambdaForm$MH)
at java.base/java.lang.invoke.DelegatingMethodHandle$Holder.delegate(DelegatingMethodHandle$Holder)
at java.base/java.lang.invoke.LambdaForm$MH/0x00000008002f3000.guard(LambdaForm$MH)
at java.base/java.lang.invoke.LambdaForm$MH/0x00000008002f3400.linkToCallSite(LambdaForm$MH)
at android.os.Handler.handleCallback(Handler.java)
at android.os.Handler.$$robo$$android_os_Handler$dispatchMessage(Handler.java:99)
at java.base/java.lang.invoke.LambdaForm$DMH/0x00000008002e5000.invokeSpecial(LambdaForm$DMH)
at java.base/java.lang.invoke.LambdaForm$MH/0x00000008002fac00.guardWithCatch(LambdaForm$MH)
at java.base/java.lang.invoke.DelegatingMethodHandle$Holder.delegate(DelegatingMethodHandle$Holder)
at java.base/java.lang.invoke.LambdaForm$MH/0x00000008002fc400.guard(LambdaForm$MH)
at java.base/java.lang.invoke.LambdaForm$MH/0x00000008002fc800.linkToCallSite(LambdaForm$MH)
at android.os.Handler.dispatchMessage(Handler.java)
Doesn't matter run from AS or gradle command line. It's throw after ~160 tests in one launch. If I try to start it separated by class, where max tests in one class ~90 it's ok. I tried to make sample of problem with simple views, but problem not reproduced. In my production project with more complex view - throws "out of memory" :(. Do you have any idea about problem?
upd: org.gradle.jvmargs=-Xmx4096M
The text was updated successfully, but these errors were encountered:
@dalapenko
Thanks!
First of all, if the baseline memory allocation is insufficient, consider adjusting the heap size for unit tests by using unitTests.maxHeapSize as follows:
Additionally, there may be memory leaks in your tests due to activities being retained in static fields. You can identify such leaks using VisualVM. Simply launch VisualVM and select the process of your tests during execution to monitor and check for leaks.
Yep, it was helpful. Thanks. I didn't find leak, everything looks normally, but max heap was 1024M and in runtime max used may amount ~1300-1400M. Increased maxHeapSize for unit Tests and it's ok
Hello. When I try to launch all my screenshot tests I'm get error:
Doesn't matter run from AS or gradle command line. It's throw after ~160 tests in one launch. If I try to start it separated by class, where max tests in one class ~90 it's ok. I tried to make sample of problem with simple views, but problem not reproduced. In my production project with more complex view - throws "out of memory" :(. Do you have any idea about problem?
upd: org.gradle.jvmargs=-Xmx4096M
The text was updated successfully, but these errors were encountered: