-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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] FF - launchPersistentContext #3230
Comments
It is not entirely clear what you'd like to see changed. Would you like When you say memory leak, do you mean that you open something, close something and it does not return memory to the OS? |
My needs is: firefox, use cache ... create 1 browser context, open page - close page, open - close ... but what I have: 1 broser window - just for fun (cant understand what for is) and 1 browser window with my test (page) ... every browser window get get system memory ... so if use browserContext.pages()[0] (open 1 browser window) use 170MB, then browserContext.newPage() take 320MB (1 url loaded) ... so more RAM and more CPU use then is opening 2 browser window instead 1 ... why you not check code to see ... 1 more bug : if I close page with await page.close(}); it will stop at close (promise not resolved)... I only can close page with: await page.close({ runBeforeUnload: true }); .... 1 more bug: then load cookies, if cookie object contain 'expires: -1' -> cookie will not add ... and many more bugs ... I cant finish my test .. every time found a bug ... if I use chromium with persistent context - can not use cache ... |
@ruslanx3m Is your concern that each new page creates a new process that would eat up another ~160Mb of RAM? This is because Playwright enforces separate separate Content process for each Page. We do it for better isolation of the tests in different pages. The same would happen if you open two tabs/windows from different domains in stock Firefox browser - each will have its own content process (in the stock browser though if two pages are from the same origin they will likely share same Content process which would result in smaller browser memory footprint overall). As far as I can tell when Page is closed all its memory is reclaimed as the content process exits, does it match your observations? |
Context:
Codet
Describe the bug
Hi, with Firefox browser, this code is opening 2 browsers window, if I use
const page = await browserContext.newPage()
, or is opening 1 browser if is useconst page = browserContext.pages()[0]
, but in my case page.close will close browser .. so every opened page is a new Browser ..... normal 180MB, but this code use 340MB (await browserContext..pages()[0] vs await browserContext.newPage()) ... why newPage (tab) open new browser window ?
firefox.launchPersistentContext - open 1 browser window (is normal)
browserContext.newPage() - open another browser window (is not normal, must open 1 tab in this browser)
so its memory leak .. but if I open 10 tests or more my pc memory will end
ps: aslushnikov, if you say "Is it purely aesthetics" ... will never use playwright (many bugs and all is 'purely aesthetics' how you like to answer, is bad answer to user feedback).
The text was updated successfully, but these errors were encountered: