Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8211053

JavaFX WebView Memory Leak

XMLWordPrintable

    • web
    • x86_64
    • generic

      A DESCRIPTION OF THE PROBLEM :
      We are using webview in our javafx desktop application. We are opening webview in a dialog to load one url. This dialog is opening on a button click. Whenever we click on that button to open a dialog , memory increases constantly.

      REGRESSION : Last worked in version 10.0.2

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Just click the button to open a webview , It will increase the memory consumption.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      It should not increase the memory consumption as it sometimes lead to application crash.
      ACTUAL -
      It will increase the memory consumption.Resulting sometimes in application crash.

      ---------- BEGIN SOURCE ----------
      public class HelpDialogController {

          @FXML
          private BorderPane helpDialogMainBorderPane;

          @FXML
          private WebView helpDialogWebView;

          public WebEngine webEngine;
          public static HelpDialogController instance;

          /**
           * Initializes the controller class.
           */
            @FXML
          public void initialize() {
              // TODO
              instance = this;
              webEngine = helpDialogWebView.getEngine();
              webEngine.load("https://csgpay.com/support?mobile_app=true");
              webEngine.setJavaScriptEnabled(true);
              // Delete cookies
              java.net.CookieHandler.setDefault(new java.net.CookieManager());
          }

      ---------- END SOURCE ----------

      FREQUENCY : always


            mbilla Murali Billa
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: