question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Working with 1.18 with 2 playwrights when the 2 object gets closed it throws HeapSpace

See original GitHub issue

Here is the info

https://stackoverflow.com/questions/71242763/java-playwright-throws-java-lang-outofmemoryerror-java-heap-space-closing-a-pla?noredirect=1

And when we connect to a wsEndPoint the problem arises when we try to close Page and Browser objects but not with Playwright object as you can see here.

20:39:13.279 [Thread-16] WARN  c.p.h.HeadlessBrowserConfig$DataPerThread.close(219) - Closing [PageImpl] object:[838546035].
java.io.IOException: Stream closed
	at java.lang.ProcessBuilder$NullOutputStream.write(ProcessBuilder.java:433)
	at java.io.OutputStream.write(OutputStream.java:116)
	at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
	at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
	at com.microsoft.playwright.impl.WriterThread.run(PipeTransport.java:167)
java.io.IOException: Stream closed
	at java.lang.ProcessBuilder$NullOutputStream.write(ProcessBuilder.java:433)
	at java.io.OutputStream.write(OutputStream.java:116)
	at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
	at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
	at java.io.FilterOutputStream.close(FilterOutputStream.java:158)
	at com.microsoft.playwright.impl.PipeTransport.close(PipeTransport.java:93)
	at com.microsoft.playwright.impl.PipeTransport.poll(PipeTransport.java:71)
	at com.microsoft.playwright.impl.Connection.processOneMessage(Connection.java:159)
	at com.microsoft.playwright.impl.ChannelOwner.runUntil(ChannelOwner.java:101)
	at com.microsoft.playwright.impl.Connection.sendMessage(Connection.java:107)
	at com.microsoft.playwright.impl.ChannelOwner.sendMessage(ChannelOwner.java:94)
	at com.microsoft.playwright.impl.JsonPipe.send(JsonPipe.java:46)
	at com.microsoft.playwright.impl.Connection.internalSendMessage(Connection.java:135)
	at com.microsoft.playwright.impl.Connection.sendMessageAsync(Connection.java:111)
	at com.microsoft.playwright.impl.Connection.sendMessage(Connection.java:107)
	at com.microsoft.playwright.impl.ChannelOwner.sendMessage(ChannelOwner.java:94)
	at com.microsoft.playwright.impl.PageImpl.close(PageImpl.java:547)
	at com.microsoft.playwright.Page.close(Page.java:3237)
20:39:13.321 [Thread-16] WARN  c.p.h.HeadlessBrowserConfig$DataPerThread.close(223) - Exception [Failed to read message from driver, pipe closed.]Closing [PageImpl] object:[838546035].

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:20 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
cortizcuellarcommented, Sep 5, 2022

Hey mate with the latest Playwright version it works. 1.25 😃 image

0reactions
mxschmittcommented, May 30, 2022

We fixed a related bug in 1.22, could you try to reproduce it there? I’m closing it in the mean time, since its most likely fixed.

Please file a new issue if you still encounter such issues with a new repro, thanks, appreciate the effort!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to deal with "java.lang.OutOfMemoryError: Java heap ...
The detail message Java heap space indicates object could not be allocated in the Java heap. This error does not necessarily imply a...
Read more >
How to Handle the OutOfMemoryError in Java - Rollbar
A java.lang.OutOfMemoryError is a runtime error in Java which occurs when the JVM is unable to allocate an object due to insufficient space ......
Read more >
Fix: "Invalid heap size" or "Could not reserve enough space"
"Invalid maximum heap size "? "Could not reserve enough space"?There's a really simple fix ... 71K views 2 years ago Minecraft Server Hosting....
Read more >
Java OutOfMemoryError Exceptions: Causes & Fixes [Tutorial]
This error means that you tried to keep too much data on the heap of the JVM process and there is not enough...
Read more >
Java Heap Space vs Stack - Memory Allocation in Java
Java Heap space is used by java runtime to allocate memory to Objects and JRE classes. Whenever we create an object, it's always...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found