. . .
//map here is an esri ArcGISMap object that holds some data and must be loaded fully
map.addDoneLoadingListener(() -> {
if (map.getLoadStatus() == LoadStatus.LOADED) {
String mapJson = map.toJson();
FileWriter jsonFileWriter = null;
try {
//file here is a valid File already created
jsonFileWriter = new FileWriter(file);
jsonFileWriter.write(mapJson);
mapDoneWriting = true;
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (jsonFileWriter != null) {
jsonFileWriter.flush();
jsonFileWriter.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
} else
throw new IllegalArgumentException("Error writing json map file");
});
. . .
Just to update you, we are debugging this currently so will report back on what we find.
I would however be interested to find out a little more about the application you are wiring. Is this a UI based application (with a JavaFX user interface), or is it a back end server app?
Awesome, thank you Mark. So this portion of code is located in our backend, solely used for calculation purposes. No UI interactions or MapViews in this portion of our system.
Just wanted to update you that we've managed to reproduce the issue. It's an unusual issue in that things work fine for several hours on Windows and Mac, but we only see the growing memory use on Linux.
Not tracked it down yet, but Linux based investigations are ongoing.
Great, glad you guys were able to reproduce the issue. I probably should have mentioned that I am using Linux for our test environment. Best of luck debugging!
Good morning, I just wanted to follow up on the status of this issue. Thanks.
We are still investigating it. I will report back once we've got a better handle on it.
Sounds good. Thank you for the response.
Howdy Mark, I believe I have tracked down the issue. I believe what is causing the memory leak is the GeometryEngine.union() method. I have some reproducer code I have sent support, and I have also pushed the new reproducer code to a branch called 'union' in the github.
Yes I'm talking to TJ from support and have your latest reproducer which looks like it will help us to narrow down the issue. Thanks for putting this together.