TripleA Logo TripleA Forum
    • TripleA Website
    • Categories
    • Recent
    • Popular
    • Users
    • Groups
    • Tags
    • Register
    • Login

    TripleA optimized JVM switches

    Scheduled Pinned Locked Moved Player Help
    18 Posts 4 Posters 4.6k Views 5 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • General_ZodG Offline
      General_Zod Lobby Moderators
      last edited by General_Zod

      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.

      1 Reply Last reply Reply Quote 0
      • RoiEXR Offline
        RoiEX Admin
        last edited by

        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.

        redrumR 1 Reply Last reply Reply Quote 0
        • redrumR Offline
          redrum Admin @RoiEX
          last edited by redrum

          @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.

          TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

          1 Reply Last reply Reply Quote 1
          • A Offline
            Ayoross
            last edited by Ayoross

            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.

            6GB heap with CMS

            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.

            1 Reply Last reply Reply Quote 0
            • RoiEXR Offline
              RoiEX Admin
              last edited by

              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.

              1 Reply Last reply Reply Quote 0
              • RoiEXR Offline
                RoiEX Admin
                last edited by RoiEX

                Found it.
                You might want to do your benchmarking with a version between when #2540 and #2617 were merged to see if that reduces the usage by a noticeable amount.

                1 Reply Last reply Reply Quote 0
                • A Offline
                  Ayoross
                  last edited by

                  ... only if I could find the corresponding jar file. I have no java dev environment 🙂

                  redrumR 1 Reply Last reply Reply Quote 0
                  • redrumR Offline
                    redrum Admin @Ayoross
                    last edited by

                    @ayoross I'm guessing @RoiEX comment was meant for me but you can find all releases here: https://github.com/triplea-game/triplea/releases

                    TripleA Developer with a Passion for AI: https://forums.triplea-game.org/topic/105/ai-development-discussion-and-feedback

                    1 Reply Last reply Reply Quote 0
                    • RoiEXR Offline
                      RoiEX Admin
                      last edited by

                      @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.

                      1 Reply Last reply Reply Quote 0
                      • A Offline
                        Ayoross
                        last edited by Ayoross

                        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)"

                        RoiEXR 1 Reply Last reply Reply Quote 1
                        • RoiEXR Offline
                          RoiEX Admin @Ayoross
                          last edited by

                          @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)

                          1 Reply Last reply Reply Quote 0
                          • A Offline
                            Ayoross
                            last edited by Ayoross

                            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 ^^

                            RoiEXR 1 Reply Last reply Reply Quote 0
                            • RoiEXR Offline
                              RoiEX Admin @Ayoross
                              last edited by

                              @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 😕

                              1 Reply Last reply Reply Quote 0

                              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
                              • 1 / 1
                              • First post
                                Last post
                              Copyright © 2016-2018 TripleA-Devs | Powered by NodeBB Forums