In my application, when running JxBrowser for a long time, it consumes so huge RAM, so I decide to dispose & re-create another instance for Browser. But when dispose, sometimes the BrowserCore processes are not terminated. Is is a bug or disposing browser cannot guarantee that it kills the BrowserCore process?
3 Answers
It is not guaranteed that the render process will be terminated. It can be held for example by the popup browser window. Chromium engine decides when to terminate browser process.
Still, it is guaranteed that BrowserCore processes would be terminated in case all the Browser instances are terminated.

- 81
- 3
-
In above case, even if I close my application, the BrowserCore processes still exist. Is there any way to terminate them? – yelliver Jan 31 '18 at 03:00
-
Try calling Browser.dispose() method for each browser instance running – Dmitry Khovyakov Feb 01 '18 at 09:13
-
I mean when I dispose & exit app, the BrowserCore processes still exist – yelliver Feb 01 '18 at 09:31
I tried to use Browser.dispose()
, and it doesn't work.
Only Engine.close()
will destroy all "BrowserCore Chromium Native Process" for the engine you have created. I wonder if there is way to recycle all Chromium Native Process. Since every creation of engine is costly and slow, if I use single engine for this app, every time I open a browser and it will create a Chromium Native Process which will not be killed with Browser.dispose() alone.

- 563
- 7
- 13
I have to manually dispose the created browser and create a new one. But sometimes, the dispose method does not work, I need to iterate all the existing browsers and kill them all:
import com.teamdev.jxbrowser.chromium.internal.ipc.IPC;
IPC.getBrowsers().forEach(Browser::dispose);

- 5,648
- 5
- 34
- 65
-
-
Thanks for providing package source, but in my case with JxBrowser 7.5, `com.teamdev.jxbrowser.chromium.` isn't available anymore. What JxBrowser version are you using? – leoflower Feb 11 '20 at 18:53
-
@leoflower: ah, we don’t use jxbrowser anymore so I forgot that its version is 7.x now. Let me take a look – yelliver Feb 12 '20 at 03:45