Live data from Hacker News

Clojure and Overtone Driving Minecraft

blog.josephwilk.net

1–10 of 18 posts

Re: Clojure and Overtone Driving Minecraft

#7
post #6

> java -XX:MaxPermSize=1G Really? I mean really?

New to java, but just wondering ... would that be due to intern()-ing (strings/symbols/etc.)?

The code doesn't look optimized with respect to reflection (i.e. avoiding it); maybe a lot of gc churn as well. The latter is a fact of life if you do lots of computations with lots of immutable collections, so it's important to identify parts which can be refactored to use Clojure transients and/or other mutable objects, but without "polluting" the entire program with mutable state.

Re: Clojure and Overtone Driving Minecraft

#8

> java -XX:MaxPermSize=1G Really? I mean really?

Spigot complains if you launch with the default MaxPermSize. The developers there could make better suggestions as to why thats the case.

Spigot warning: ``` Warning, your max perm gen size is not set or less than 128mb. It is recommended you restart Java with the following argument: -XX:MaxPermSize=128M Please see http://www.spigotmc.org/wiki/changing-permgen-size/ for more details and more in-depth instructions. ```

Re: Clojure and Overtone Driving Minecraft

#9
post #6

Earlier quoted context omitted.

New to java, but just wondering ... would that be due to intern()-ing (strings/symbols/etc.)?

The code doesn't look optimized with respect to reflection (i.e. avoiding it); maybe a lot of gc churn as well. The latter is a fact of life if you do lots of computations with lots of immutable collections, so it's important to identify parts which can be refactored to use Clojure transients and/or other mutable objects, but without "polluting" the entire program with mutable state.

Oh, good point on the reflection optimisation. That will definitely be useful for squeezing a bit more performance out of the graphics. Will be interesting to profile and see where the pain points are. From my experience the worst performance points are within Bukkit and occur when any block has gravity calculations to perform. I purposely avoided lava + water due to this.

Re: Clojure and Overtone Driving Minecraft

#10

> java -XX:MaxPermSize=1G Really? I mean really?

Yeah, don't do that. Run SpigotMC under Java 8 with the following flags:

-d64 (force a 64-bit data model, although usually this isn't necessary)

-server (use the server-optimized JVM instead of the desktop-optimized one, again, may not be necessary)

-Xmx1G (start with this heap memory limit and increase if necessary)

-XX:+UseConcMarkSweepGC (for multithreaded GC)

-XX:+CMSIncrementalMode (only use on computers that support 1 or 2 hardware threads)

-XX:+AggressiveOpts (enables additional JVM optimizations)

There's a ton of bad advice out there when it comes to JVM configuration and Minecraft. The above comes from my understanding of this somewhat dated Java GC tuning guide (http://www.oracle.com/technetwork/java/gc-tuning-6-140523.ht...) and sk89q's excellent Minecraft server tuning guide (http://www.sk89q.com/2013/03/improving-your-minecraft-server...), coupled with small-scale server profiling on my part.

Post reply on HN