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

Closing not working as expected #468

Open
naniox2 opened this issue Mar 10, 2024 · 3 comments
Open

Closing not working as expected #468

naniox2 opened this issue Mar 10, 2024 · 3 comments
Labels
bug Bug report

Comments

@naniox2
Copy link

naniox2 commented Mar 10, 2024

Describe the bug
I'm having a lot of trouble closing the browser

Processes sometimes remain after closing the browser and for some reason they load the CPU by 100%

browser.close and browser.doclose do not work (do not close processes)
also cefapp.dispose does not close all processes

To Reproduce

public static void main(String[] args) throws Exception {
    CefSettings settings = new CefSettings();
    settings.windowless_rendering_enabled = true;
    CefApp cefApp = CefApp.getInstance(settings);
    CefClient client = cefApp.createClient();
    
    for (int i = 0; i < 10; i++) {
        CefBrowser browser = client.createBrowser("https://example.com/", true, true);
        browser.createImmediately();
      
        Thread.sleep(5000L);
        browser.getSource(System.out::println);
      
        browser.close(true);
        ThreadUtil.sleep(1000L);
    }
    
    client.dispose();
    cefApp.dispose();
    
    System.exit(0);
}

Expected behavior
Should close all processes using cefapp.dispose or close all browser processes and not add new ones using browser.close
And don't load CPU by 100%

Screenshots
image

Versions (please complete the following information):

Additional context
Sometimes it closes all processes if I use 1 browser, but sometimes 1 process remains, which for some reason loads CPU by 5-20%.
In the code i gave above i create and close browsers many times, but it creates new processes each time

@naniox2 naniox2 added the bug Bug report label Mar 10, 2024
@wjw465150
Copy link

I also found this problem, calling client.dispose() did not terminate the jcef_helper process.
The version I use is:
OS: CentOS 7
Java Version: JDK 17.0.6
JCEF Version: jcef-api-jcef-0b8e42e
CEF Version: 122.1.10+gc902316+chromium-122.0.6261.112

@magreenblatt
Copy link
Collaborator

Some helper processes are expected to remain until the application terminates. See also chromiumembedded/cef#3614

@wjw465150
Copy link

This problem is not found under windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug report
Projects
None yet
Development

No branches or pull requests

3 participants