-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[Bug] Memory leak when evaluating #21345
Comments
|
Can you provide us a repro which we can run locally? |
After testing, it was found that the causes are as follows: When calling js to obtain the page data, need to minimize the content returned, I will need to return the data by reconstructing the object, only return a few fields, then can greatly reduce the memory, it is not clear what is the cause, tomorrow I upload a test code |
|
I was able to track it down to this specific line: playwright/packages/playwright-core/src/server/javascript.ts Lines 76 to 81 in 9ca9b08
and this upstream issue: nodejs/node#17469 we'll implement a workaround accordingly. |
Context:
Playwright Version: 1.27.2
Operating System: Windows
.NET version: .NET 6
Browser: Chrome v 110.0.5481.100
browserArgs:"--start-maximized", "--disable-site-isolation-trials", "--disable-blink-features", "--disable-blink-features=AutomationControlled"
After running for about 15-20 minutes
c# code:
var roundsElem = (await gameFrame.EvaluateAsync(@"() => { return e_getRounds();}")).Value;
js code:
function e_getRounds() { return PlazaManager.getInstance().videosMaps.table; }
Injected code:
await frame.AddScriptTagAsync(new FrameAddScriptTagOptions { Content = ClientConsts.gameRPCScript });
The page is in the iframe, and the js code is injected by listening to the FrameNavigated event of the iframe. Everything is fine without calling ifame.EvaluateAsync, which is enabled every 3 seconds, increases the node memory footprint until a memory leak occurs.
Also tried using 1.28.0/1.29.0/1.30.0 and had the same problem.
How do I fix it?
The text was updated successfully, but these errors were encountered: