Skip to content
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

JS binding causes memory leak in 65+ #2390

Closed
chylex opened this issue May 12, 2018 · 5 comments
Closed

JS binding causes memory leak in 65+ #2390

chylex opened this issue May 12, 2018 · 5 comments
Labels
upstream These issues require fixing in the Chromium Embedded Framework(CEF) or Chromium.
Milestone

Comments

@chylex
Copy link
Contributor

chylex commented May 12, 2018

  • What version of the product are you using?

    • Reproduced from c37dbcd (commit after upgrade to CEF 65) to 22b299e (latest master w/ 66)
  • What architecture x86 or x64?

    • Both x86 and x64
  • On what operating system?

    • Tested on Win 7 & 10
  • Are you using WinForms, WPF or OffScreen?

    • WinForms
  • What steps will reproduce the problem?

    • Using RegisterAsyncJsObject on a browser and then reloading that browser keeps increasing memory usage and never releases it
  • Reproduction example

@amaitland amaitland changed the title Legacy JS binding causes memory leak in 65+ JS binding causes memory leak in 65+ May 15, 2018
@amaitland
Copy link
Member

Appears to be a problem with the newer binding method also.

@amaitland amaitland added this to the 65.0.0 milestone May 15, 2018
@amaitland amaitland added the upstream These issues require fixing in the Chromium Embedded Framework(CEF) or Chromium. label May 15, 2018
@amaitland
Copy link
Member

The destructor isn't being called in newer branches for the CefV8Handler implementations so the process is leaking memory 😦

It appears to be related to how we're currently storing a CefV8Value reference to the promise creator function used by the async code. It's possible to obtain the promise on Execute so we don't need to hold the reference. The destructor seems to be called now, so memory is freed.

Relevant commit for cefsharp/65 is 930846e and for master see 5f3dca4

@amaitland
Copy link
Member

Reproduction example

Get chylex/CefSharp@cd9dad6 and run CefSharp.WinForms.Example
Repeatedly click Go or reload the page, memory usage of the subprocess should keep rising forever

@chylex Thanks for taking the time to create a example, greatly appreciated 👍

@chylex
Copy link
Contributor Author

chylex commented May 15, 2018

Tested with latest build, appears to be working fine now. Thanks!

@amaitland
Copy link
Member

Thanks for checking 👍

Closing as appears the problem is resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream These issues require fixing in the Chromium Embedded Framework(CEF) or Chromium.
Projects
None yet
Development

No branches or pull requests

2 participants