Hang When saved
Opened this issue · 30 comments
Hi! Thank you for the game update! After i update, everything seem to be doing great, till i save~ it hang on me~
Error msg as below
An unexpected error occurred.
You should consider submitting an error report via the project issue list:
https://github.com/akarnokd/open-ig/issues
Please include the following diagnostic information followed by the error stacktrace(s):
Java version: 1.8.0_361
Java vendor: Oracle Corporation (http://java.oracle.com/)
Java class version: 52.0
Operating system: Windows 10, amd64, 10.0
Game version: 0.95.248
Command line: [-memonce, -en]
Available memory: 174 MB
Maximum memory: 910 MB
Parallelism: 12
Language: en
Date and time: 2024-06-07T23:33:47.622Z
A crash save may have been created. Please attach it in the issue report (zipped).
javax.xml.stream.XMLStreamException: java.io.EOFException
at hu.openig.utils.XElement.parseXMLGZ(XElement.java:327)
at hu.openig.screen.items.LoadSaveScreen.findSaves(LoadSaveScreen.java:2237)
at hu.openig.screen.items.LoadSaveScreen$16.doInBackground(LoadSaveScreen.java:744)
at hu.openig.screen.items.LoadSaveScreen$16.doInBackground(LoadSaveScreen.java:1)
at javax.swing.SwingWorker$1.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at javax.swing.SwingWorker.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.EOFException
at java.util.zip.GZIPInputStream.readUByte(Unknown Source)
at java.util.zip.GZIPInputStream.readUShort(Unknown Source)
at java.util.zip.GZIPInputStream.readHeader(Unknown Source)
at java.util.zip.GZIPInputStream.(Unknown Source)
at java.util.zip.GZIPInputStream.(Unknown Source)
at hu.openig.utils.XElement.parseXMLGZ(XElement.java:323)
... 9 more
javax.xml.stream.XMLStreamException: java.io.EOFException
at hu.openig.utils.XElement.parseXMLGZ(XElement.java:327)
at hu.openig.screen.items.LoadSaveScreen.findSaves(LoadSaveScreen.java:2237)
at hu.openig.screen.items.LoadSaveScreen$16.doInBackground(LoadSaveScreen.java:744)
at hu.openig.screen.items.LoadSaveScreen$16.doInBackground(LoadSaveScreen.java:1)
at javax.swing.SwingWorker$1.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at javax.swing.SwingWorker.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.EOFException
at java.util.zip.GZIPInputStream.readUByte(Unknown Source)
at java.util.zip.GZIPInputStream.readUShort(Unknown Source)
at java.util.zip.GZIPInputStream.readHeader(Unknown Source)
at java.util.zip.GZIPInputStream.(Unknown Source)
at java.util.zip.GZIPInputStream.(Unknown Source)
at hu.openig.utils.XElement.parseXMLGZ(XElement.java:323)
... 9 more
javax.xml.stream.XMLStreamException: java.io.EOFException
at hu.openig.utils.XElement.parseXMLGZ(XElement.java:327)
at hu.openig.screen.items.LoadSaveScreen.findSaves(LoadSaveScreen.java:2237)
at hu.openig.screen.items.LoadSaveScreen$16.doInBackground(LoadSaveScreen.java:744)
at hu.openig.screen.items.LoadSaveScreen$16.doInBackground(LoadSaveScreen.java:1)
at javax.swing.SwingWorker$1.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at javax.swing.SwingWorker.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.EOFException
at java.util.zip.GZIPInputStream.readUByte(Unknown Source)
at java.util.zip.GZIPInputStream.readUShort(Unknown Source)
at java.util.zip.GZIPInputStream.readHeader(Unknown Source)
at java.util.zip.GZIPInputStream.(Unknown Source)
at java.util.zip.GZIPInputStream.(Unknown Source)
at hu.openig.utils.XElement.parseXMLGZ(XElement.java:323)
... 9 more
save files zip as attached
save.zip
Hello
It seems there were some leftover corrupted saves from the bug fixed, that caused this when reading the save files.
I cleaned those up attached here
saves_fixed.zip
Which autosave causes the second error?
As you can see the recent ones at 332PM, it just hang on me after 5 mins....
save.zip
This is screen record of how it hang~
Error Hang.zip
I tried running your save for a while but could not reproduce the error.
There should be a few .log files in your open-ig folder, could you please post those here so I can better look what might have happened.
After trying the java version in your error report I did manage to have a similar error.
For the time being I suggest updating to a more recent java main version.
The one suggested in the readme should not cause this error.
https://adoptium.net/
Ok download the adoptium so this is the upodateed java eh? here you go log file!@
You could also try using a 64bit version of java 8 from the page below. It also seemed to work just fine.
https://www.java.com/download/manual.jsp
The jre installed by the online installer produced the bug for me as well.
yeah my previous is 64bit ;(
The overall problem is that the game runs out of available memory. The short term solution is to use newer versions of java as those have better memory handling.
Is it the java 8 64bit or the adoptium one?
Remember this setting? #1149 (comment)
Go in there and change the number to 1500 and see if that hangs.
@MK-coder-bit If you installed the java 8 64bit I suggested, that would've overwritten the adoptium installation settings so just to be sure reinstall the adoptium again.
For me it hang even with 2048MB memory limit when using a 32bit jvm. I'm working on a PR that might alleviate some of the issue.
On a more recent java the GC seems to do it's job fine for the most part.
OMG changing to 1500 setting works! thank you guys! if anything hang, let you know again!
It turns out, not surprisingly, that this was also caused by my diplomacy bug.
As relations were not initialized correctly, when meeting new races a new message was generated about a new discovery every time a fleet/planet of an alien showed up in radar range. This created ~40Mb worth of messages about new alien races. Add in the overhead of these being loaded and rendered in-game, took up enough memory to make the game crash.
Deleting the message history in the bottom message bar solves this.