I am using a static observable list for a tableview in a javafx application.
public class TableData {
private static ObservableList<MyObject> data = FXCollections.observableArrayList();
public static ObservableList<MyObject> getData(){
return data;
}
}
When I load new Data I tried several approaches to remove the “old“ data to release memory, like
TableData.getData().clear();
or
TableData.getData() = FXCollections.observableArrayList();
or even
for(int i=0; i< TableData.getData().size(); i++){
MyObject mo = TableData.getData().get(i);
mo=null;
}
But still no Memory is released (checked with netbeans Analyzer)
Can anyboy help?