View Issue Details

IDProjectCategoryView StatusLast Update
0005952Spring engineAIpublic2019-10-14 22:07
ReporterDeinFreund Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status newResolutionopen 
Product Version104.0 +git 
Summary0005952: Java AIs are not killed on Spring.Reload
DescriptionWhen playing multiple games in a row, Java AIs start colonizing spring's JVM memory. It's possible to reduce the impact by releasing as much memory as possible in the AI once the game is over. It would be best to kill the AI completely though.
Steps To ReproducePlay a game with a java AI.
Restart the game.
The new game has two AIs in the JVM, the old one simply doesn't receive any call-ins anymore.
TagsNo tags attached.
Checked infolog.txt for Errors

Relationships

related to 0006300 new AI Java AI interface sometimes throws "does not implement" error on startup 

Activities

abma

2018-04-09 11:34

administrator   ~0018997

atm this is by design:

existing env is not reused:
https://github.com/spring/spring/blob/develop/AI/Interfaces/Java/src/main/native/JavaBridge.c#L1253

existing env is not freed:
https://github.com/spring/spring/blob/develop/AI/Interfaces/Java/src/main/native/JavaBridge.c#L1264

Kloot

2018-04-09 12:59

developer   ~0018998

Last edited: 2018-04-09 13:00

I remember there being some sort (forgot the details) of issue with sending release events to Java AI's, which was apparently "solved" by making java_skirmishAI_release a no-op.

the Java bridge code also long predates Spring.Reload so envs not being freed wasn't a real problem until that became available and reliable.

aeonios

2019-09-12 08:21

reporter   ~0020143

Maybe that's why implementing release() didn't do anything to fix the problem. :P

I can confirm that the AI almost always fails to load by the third game in using default JRE settings. A failure to free the memory from previously instantiated AIs could probably cause that.

I'm not sure if spring crashing on shutdown is related or not, but there was at one time a correlation with java AIs and cpp AIs and crashing when running both in the same game. I'll have to test that later and maybe make a separate issue for it.

abma

2019-10-14 22:07

administrator   ~0020187

with spring.reload this makes java ais IMHO unusable -> major

Issue History

Date Modified Username Field Change
2018-04-04 21:29 DeinFreund New Issue
2018-04-09 11:34 abma Note Added: 0018997
2018-04-09 12:59 Kloot Note Added: 0018998
2018-04-09 13:00 Kloot Note Edited: 0018998
2019-09-10 11:30 abma Relationship added related to 0006300
2019-09-12 08:21 aeonios Note Added: 0020143
2019-10-14 22:06 abma Severity minor => major
2019-10-14 22:06 abma Summary Java AIs are not killed on Spring.Restart => Java AIs are not killed on Spring.Reload
2019-10-14 22:07 abma Note Added: 0020187