Kneesnap / FrogLord

An editor for Frogger: He's Back (1997)
https://highwayfrogs.net
MIT License
117 stars 9 forks source link

OutOfMemoryException in certain versions of Java. #10

Open Kneesnap opened 4 years ago

Kneesnap commented 4 years ago

For some reason, certain versions of Java run into issues displaying the map viewer and saving the MWD.

Working Versions: 1.8.0_111, 1.8.0_144, 1.8.0_172, and 1.8.0_181 Not Working Versions: 1.8.0_161, 1.8.0_201, and 1.8.0_231

TextureTree is pretty memory intensive, but I'm not sure why the different java version causes issues or not. We should probably attempt to reduce memory usage by a bit, but also look into why different java versions may cause this issue.

Some setups seem to be able to save properly, others seem to just break upon doing things like opening maps.

Setups: 1.8.0_231-b11 with 247MB Total, 247MB Max - Does not save. (Desktop, RexyWood, 4GB) 1.8.0_144-b01 with 476MB Total, 3GB Max - Works fine. (Desktop, Mine, 16GB) 1.8.0_111-b14 with ?MB Total ? - Does not save, Cannot open maps. (Desktop, Kao, ?)

Kneesnap commented 4 years ago

It appears there's a memory leak. If you load a map, it keeps that MapMesh loaded in memory even after exiting. Honestly, I've looked pretty hard for the source of the leak, and I can't find it. I'm thinking that maybe it's possible the UI components themselves are either loaded indirectly by JavaFX, or directly by us, but YourKit won't seem to give me information on what is referencing the MapMeshes.

Kneesnap commented 4 years ago

I cleared everything, stuff was still kept in memory. I think we're going to somehow have to workaround the problem, which seems most likely to be related to JavaFX

Kneesnap commented 4 years ago

This should be better improved now, since the memory leaks are gone. We still need to do further research on why this happens on certain Java versions when saving though. I'll see if Kao is willing to help profile the issue.

sylv256 commented 4 years ago

May I also add that Java 1.8.0_131 works as well?

Kneesnap commented 3 years ago

This needs testing after the new PP20 packer. @andyeder can you read your discord DMs when you get a chance? It regards testing this + some other things.