Menu

#71 RobocodeEngine becomes slower the more battles that are run

1.4.2
closed
5
2012-10-12
2007-04-10
No

Taken from the Help forum:

After using the robocode engine a lot, i recognized that battles are getting slower and slower over time, so i reinit the robocodeengines fromt time to time but this doesn't seem to help much. Because i work with multiple robocodengines i thought, the problem could be here so i wrote a simple test application (without threads).
In the test application there is a mainloop where every loop a robocodeengine engine, some robot- and a battlespecification is created to have some battles. At the end of the loop everything should be dereferenced and collected by the gc.
I used this testapp with the netbeans profiler and did a memory print every round before the initializations and it seems especially instances of Object, Thread and Char [] are growing every loop.
All three share some similar trace(s):

robocode.peer.robot.RobotThreadManager.start()
robocode.battle.Battles.setupRound()
robocode.battle.Battle.run()
java.lan.Thread.run()

I dont understand why those instances are still there after the robocode engines are gone... and why are they growing?
Could this be some sort of memory leak or do i understand something wrong?

Discussion

  • Flemming N. Larsen

    Logged In: YES
    user_id=1249353
    Originator: YES

    I will definitely turn my attension into this issue now. I have got a similar bug report (per mail) telling that this is also happening with RobocodeJGAP, but which only runs a single instance of RobocodeEngine.

    I have already done memory and object istannce profile monitoring (using TPTP in Eclipse), but currently without any luck. I will try to setup everything as you describe, and then monotor the behaviour using the MXBeans for Java 5 to get a real clue of what is going wrong.

    Any help is appreciated. E.g. the source code for your test scenario (even though you described it quite well ;-)

     
  • Flemming N. Larsen

    Logged In: YES
    user_id=1249353
    Originator: YES

    Fixed in Robocode 1.4.2 released today

     

Log in to post a comment.