yelliver
yelliver

Reputation: 5936

JxBrowser - dispose but there's still BrowserCore processes in Task Manager

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?

Upvotes: 3

Views: 883

Answers (3)

yelliver
yelliver

Reputation: 5936

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);

Upvotes: 0

leoflower
leoflower

Reputation: 575

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.

Upvotes: 0

Dmitry Khovyakov
Dmitry Khovyakov

Reputation: 81

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.

Upvotes: 0

Related Questions