New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Working with 1.18 with 2 playwrights when the 2 object gets closed it throws HeapSpace #827
Comments
You are running out of memory, looks like the machine doesn't have enough memory to run multiple playwrights on it. If you still think this is a bug in the playwright please provide a repro that we could run locally. |
I am running with -Xms3g -Xmx3g when the shutdown is call i am using like 800 mb later the Out of memory exception is thrown when i call shutdown on the second playwright i will test this the same scenario with more memory. |
Running with -Xms20g -Xmx20g with connecting to a wsEndPoint Browserless in this case. When trying to close Page object it throws
20 GB is a lot of memory. |
Can you share a repro that we could run locally? |
I will try that today mate. :) |
Does it reproduce with local browsers instead of browserless ? |
I will let you know tomorrow :) |
In the previous snippet i was using browserless not using Browserless i mean instead of using this.browser = browserType.connect("wss://chrome.browserless.io/playwright?token="+token); Using this.browser = browserType.launch(); With 3GB of ram it closes Page + Browser object but it throws heap closing the 1 playwright object. Trying to understand the dump i see something like this. With 35 GB it hangs closing the page of the second thread. Please note that when the shutdown process started is the Thread-0 is the thread i think that will kill Java process. As you can see in the code i put a .sleep this is mainly for see what happens when a Ctrl+C is call or if not how behave the code when a the regular flow is not interrupted. If not CTRL+C is not pressed and the code flows normally even with 3GB of ram it closes Smoothly. As you can see here the thread is main instead of Thread-0 It seems it have what to do which Thread closes the objects :( After all the work is done and calling System.exit(0); even on a 1GB ram it works smoothly even with [Thread-1] It seems that playwright is suffering when Ctrl+C is call/pressed or when AWS shutdowns the machine killing the Java process |
Try running it with |
Are this system properties o maven commands? we are using gradle.. |
These are environment variables. |
I will do this mate and i will let you my kid is in the hospital :( |
With Environment variables set. |
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! |
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.
The text was updated successfully, but these errors were encountered: