Menu

#159 Fix overkilled garbage collection on static fields

1.9.2.4
closed
5
2014-11-20
2014-10-05
No

jprudent (jerp2) proposes a better fix for Bug-244 regarding overkilled garbage collection on static fields on robots. His comment can be read here.

I really like his suggestion:
"To fix this more properly, I wouldn't clean any of the class loaded by a parent classloader. In my case, clojure.jar is added in classpath and any related classes is loaded via the Container classloader."

This is the way it should be fixed so Clojure and other languages as well will be supported by Robocode. :-)

Related

Feature Requests: #159

Discussion

  • Flemming N. Larsen

    I have created an 1.9.2.4 Alpha version of Robocode here with a possible fix.

    Please try it out and check if this fixes the issue with Clojure.

     
  • jerp2

    jerp2 - 2014-10-10

    Hi,

    I've tried. It successfully load the first round now !!!

    ... but ... on the second round, hitting the Restart button, I get NullPointerException. I didn't have time to find why, but I would bet it's the cleaning. Here is my guess: the sorting between robot classes and system classes is perfectly done so clojure classes don't get clean up. Still, the rebot generated with clojure has some static fields that get clean up, hence the NPE.

    But, I think the fix is fine for Scala, must try this out !

    I'll give a deeper look this weekend to know exactly what is happening.

    Thanks :)

     
  • Flemming N. Larsen

    You are welcome.

    If you have a jar file or the classes for the robot(s). Or the sources + a short description of how to compile your robots for testing this change, you are welcome to send it to me or attach it here. Then I will try to find out, what is going on inside Robocode since it causes problems with rounds two.

     
    • jerp2

      jerp2 - 2014-10-12

      Hi,

      Here is my repo : https://github.com/jprudent/clobocode

      The bots are doing almost nothing, except gearing radar and gun when round
      starts.

      There is a Readme that explains how to build. The generated jar is loadable
      in Robocode.

      Here is the jars :
      https://drive.google.com/file/d/0B9LaCjHSfccCSXZUbE1kQkpJLUE/view?usp=sharing

      Thanks :)

      On Sat, Oct 11, 2014 at 4:13 AM, Flemming N. Larsen fnl@users.sf.net
      wrote:

      You are welcome.

      If you have a jar file or the classes for the robot(s). Or the sources + a
      short description of how to compile your robots for testing this change,
      you are welcome to send it to me or attach it here. Then I will try to find
      out, what is going on inside Robocode since it causes problems with rounds
      two.


      Status: open
      Group: Future Release
      Labels: static field GC Clojure
      Created: Sun Oct 05, 2014 08:02 PM UTC by Flemming N. Larsen
      Last Updated: Fri Oct 10, 2014 05:45 AM UTC
      Owner: Flemming N. Larsen

      jprudent (jerp2) proposes a better fix for Bug-244
      https://sourceforge.net/p/robocode/bugs/244 regarding overkilled
      garbage collection on static fields on robots. His comment can be read
      here https://sourceforge.net/p/robocode/bugs/244/?limit=10&page=1#68bd.

      I really like his suggestion:
      "To fix this more properly, I wouldn't clean any of the class loaded by a
      parent classloader. In my case, clojure.jar is added in classpath and any
      related classes is loaded via the Container classloader."

      This is the way it should be fixed so Clojure and other languages as well
      will be supported by Robocode. :-)


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/robocode/feature-requests/159/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

      --
      (Jérôme Prudent)

       

      Related

      Feature Requests: #159

  • Flemming N. Larsen

    Thank you for sending the zipped jar file. I use the clojure-1.5.1.jar which I have added to the classpath of the JVM that runs Robocode and also disabled security (-DNOSECURITY=true).

    You are right. Your robots seems to work with the first round, and I also get a NPE from the robots, with the 2nd round.

    I will dig into this and figure out what goes wrong. Please don't get impatient with me, as I might first get time for it in the end of the weekend. Let's see. :-)

     
    • jerp2

      jerp2 - 2014-10-15

      Hi,

      You know I am not in a hurry AT ALL. Take your time. I lack some free time
      myself ;)

      On Tue, Oct 14, 2014 at 11:45 PM, Flemming N. Larsen fnl@users.sf.net
      wrote:

      Thank you for sending the zipped jar file. I use the clojure-1.5.1.jar
      http://www.java2s.com/Code/JarDownload/clojure/clojure-1.5.1.jar.zip
      which I have added to the classpath of the JVM that runs Robocode and also
      disabled security (-DNOSECURITY=true).

      You are right. Your robots seems to work with the first round, and I also
      get a NPE from the robots, with the 2nd round.

      I will dig into this and figure out what goes wrong. Please don't get
      impatient with me, as I might first get time for it in the end of the
      weekend. Let's see. :-)


      Status: open
      Group: Future Release
      Labels: static field GC Clojure
      Created: Sun Oct 05, 2014 08:02 PM UTC by Flemming N. Larsen
      Last Updated: Fri Oct 10, 2014 08:13 PM UTC
      Owner: Flemming N. Larsen

      jprudent (jerp2) proposes a better fix for Bug-244
      https://sourceforge.net/p/robocode/bugs/244 regarding overkilled
      garbage collection on static fields on robots. His comment can be read
      here https://sourceforge.net/p/robocode/bugs/244/?limit=10&page=1#68bd.

      I really like his suggestion:
      "To fix this more properly, I wouldn't clean any of the class loaded by a
      parent classloader. In my case, clojure.jar is added in classpath and any
      related classes is loaded via the Container classloader."

      This is the way it should be fixed so Clojure and other languages as well
      will be supported by Robocode. :-)


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/robocode/feature-requests/159/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

      --
      (Jérôme Prudent)

       

      Related

      Feature Requests: #159

  • Flemming N. Larsen

    Hi again,
    I have made a new Alpha-2 version here:
    http://robocode.sourceforge.net/files/robocode-1.9.2.4-Alpha-2-setup.jar

    This version works for me with your robots. :-)

     
  • Flemming N. Larsen

    Closed as this has been implemented in 1.9.2.4

     
  • Flemming N. Larsen

    • status: open --> closed
    • Group: Future Release --> 1.9.2.4
     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.