JavaFX Memory leak

2020-05-04 Thread Ty Young

Hi,


I'm trying to debug a memory leak in my application using Java Mission 
Control & Flight Recorder[1]. Going down the tree it gives, it seems to 
be caused by this code:



Series series = super.getSeries();

ObservableList> points = series.getData();

if(points.size() > super.getSeconds().get()-1)
{
    points.remove(super.getSeconds().get()-1);

    points.add(0, new Data(0, readable.getValue().get().longValue()));
}
else
    points.add(0, new Data(0, readable.getValue().get().longValue()));

for(int i = 1; i < points.size(); i++)
{
    Data data = points.get(i);
    data.setXValue(i+1);
}


...but doing a print statement to print the size of the Points list 
shows that the max size is always 60, as expected.



This increase in memory is consistent with multiple recordings, so I do 
think it's a leak but I have no idea what's causing it. Is this leak 
from JavaFX's end or my code?



[1] https://imgur.com/a/oNYb6Q7



Javafx memory leak issue

2018-08-31 Thread Dhruvi Vaza
Hello,

I am using javafx webview in my desktop application to load a url. I am
opening webview on dialog. When I press a button to open a dialog
containing webview. I get memory leak issue. sometimes it leads to crashing
of application.

Please give me proper solution.

*The below code I have used:*
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());
}


-- 
Thanks & Regards,
Dhruvi Vaza
Jr. Software Developer
Ecosmob Technologies Pvt. Ltd.