TripleA optimized JVM switches
-
Another game that relies heavily on conditions and triggers is "Blue Vs Gray". Don't let the graphics fool you this is a well made game (very under rated). Just it bogs way down if guests join while in lobby.
-
Interesting. The last time I ran into an OutOfMemoryError this was due to a (by myself) poorly implemented breadth-first-search.
Might be worth to look at the code to check if some uneccessary object creations can be avoided. -
@roiex Yeah, I have a feeling we have a memory leak somewhere. My gut says its something to do with the battle calc as I've noticed my memory going up over time if I play a long session on a complex map. It seems to be true for the AI which uses the calc as well.
@Ayoross An interesting test would be trying the Fast AI instead of Hard AI as the main difference between them is the Fast AI doesn't use the battle calc.
-
I don't think there's a leak, I didn't see the tenured space usage growing endlessly in a 2-hours long game.
However it would be a good idea to decrease the memory footprint of the hard AI.
Concerning the fast AI, as far as I know (few tests), there's no issue with a 1 GB heap, but the creator of GW recommends the use of the hard AI.
Note also that a more simple map would probably require less resources, all my testing was based on GW.
-
I recall @LaFayette submitted a PR which reworked a lot of the OddsCalculator code, but the changes got reverted, because of unintentional uneccessary network usage, that slowed down the OddsCalculator by a lot when playing a networked game.
Might be worth to revisit that. -
-
... only if I could find the corresponding jar file. I have no java dev environment

-
@ayoross I'm guessing @RoiEX comment was meant for me but you can find all releases here: https://github.com/triplea-game/triplea/releases
-
@redrum My comment was for everybody interested ^^
Found a release with this change: https://github.com/triplea-game/triplea/releases/tag/1.9.0.0.7395@Ayoross Regarding CMS. Keep in mind that CMS is considered to be deprecated as of Java 9 per JEP 291, it will still work, but warn users when invoked from the command line.
-
I think CMS is widely used and will still work some more time. Anyway, G1 is supposed to replace it sooner or later but the "battle calculator" creates huge objects, causing humongous allocations, which can be quite harmful. I tried with 6 MB regions, they still happen. All java apps using large objects are not good candidates for G1 migration, especially when the CMS works fine. I have the same problem using apache jmeter on HTTP content. That's only my opinion, of course.
Note also this :
"This JEP does not specify the major release in which support for CMS will be dropped. The decision of when to do that will be informed by the extent to which the G1 collector proves to be a suitable replacement for CMS. In the meantime, CMS users are encouraged to migrate to the G1 collector (-XX:+UseG1GC)" -
@ayoross I agree.
You might want to point out people might experience issues in the future or see a scary warning when launching from the command line (not sure when this warning is logged, or if JVM warnings are being swallowed) -
Hi,
I tried the 1.9.0.0.7395 release, unfortunately the game crashes after 1 or 2 minutes on a functional error like "Possible Infinite Loop: Wrong number of casualties selected: ...".
I does not work long enough to be sure, but it still looked like the memory usage was significantly smaller. You should perhaps consider reusing this code after some cleanup.
With this code, the G1 collector should probably work fine ^^
-
@ayoross Well I opened a PR a day ago that tries to cleanup the code: https://github.com/triplea-game/triplea/pull/2950
However we're running into the exact same issue you just described. (By we I mean @ssoloff and myself.)
We're currently assuming it has something to do with concurrency issues.
However in case we get everything working it does currently not look like the memory footprint is going down.
Looks like this requires much more changes than a small algorithm
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login