Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (744)
Games in Android Showcase (225)
games submitted by our members
Games in WIP (825)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Java 9 GC  (Read 899 times)
0 Members and 1 Guest are viewing this topic.
Online princec

« JGO Spiffy Duke »


Medals: 980
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Posted 2017-11-30 09:33:14 »

The new default collector in Java 9 is G1. This is bad, because G1 is hopelessly slow and everything runs like it's going through treacle.
Can anyone recommend a set of commandline magic parameters that mimics good ol' -Xincgc?

Cas Smiley

Offline ra4king

JGO Kernel


Medals: 506
Projects: 3
Exp: 5 years


I'm the King!


« Reply #1 - Posted 2017-11-30 10:59:02 »

Wtf it looks like they removed ALL garbage collectors other than G1?

Offline Spasi
« Reply #2 - Posted 2017-11-30 11:12:28 »

It would be useful to see a simple test program that demonstrates bad performance with G1GC. It certainly makes an interesting set of tradeoffs, but I haven't seen an application where enabling G1GC has such a pronounced impact on performance.

Cas, would you be able to post such a program?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Online princec

« JGO Spiffy Duke »


Medals: 980
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #3 - Posted 2017-11-30 11:24:24 »

Unfortunately not - all I can tell you is that it halves the framerate of Battledroid, and Eclipse seems to almost grind to a halt under Java 9.
(All 64-bit stuff, compressed OOPS)

Cas Smiley

Offline nsigma
« Reply #4 - Posted 2017-11-30 11:37:11 »

More good reasons to stick with the Java 8 LTS for a while!  Wink

Still, -Xincgc is kind of still there, if you can find documentation of what it actually translated to (got a note somewhere I'll see if I can dig out).  See https://docs.oracle.com/javase/9/gctuning/concurrent-mark-sweep-cms-collector.htm

I did read on the OpenJDK list a bunch of people (inc. Google and Red Hat people IIRC) talking about undeprecating and improving CMS - think Oracle are happy for that if they don't have to do anything.

Praxis LIVE - hybrid visual IDE for (live) creative coding
Offline Spasi
« Reply #5 - Posted 2017-11-30 11:38:05 »

Could you describe what Battledroid's doing in the hot path? Are there many allocations? Are there many reference writes (e.g. a BVH getting updated)? This could be a matter of replacing OO code with something more data oriented.
Online princec

« JGO Spiffy Duke »


Medals: 980
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #6 - Posted 2017-11-30 12:41:27 »

@Spasi - it's been quite a long time since I really delved into it in any depth. The point being though that simply changing the garbage collector to -Xincgc doubled my framerate and the amount of garbage I was generating was already quite modest really. I did in the end even have to do something data oriented just to get my A* stuff working fast enough - instead of allocating and forgetting tens of thousands of A* "Nodes", I instead used large expanding arrays of int[] instead, effectively mostly managing my own memory... crap.

@Nsigma - thanks for the link (obviously, it's Googlable, but it's good to have it recorded here for posterity) - I guess I'll try each combo out in turn to find out what's best for my usage.

Cas Smiley

Offline h.pernpeintner

JGO Knight


Medals: 69



« Reply #7 - Posted 2017-11-30 13:41:38 »

Really annoying, that the said to be best Garbage Collector seems to perform worse for games.

@princecc: Would you mind take a look at your app with JMC and show us some metrics comparing the old state and the state after your latest changes? I found some comparisons in the internet, where G1 reduced the max pause time while keeping avg pause time equivalent to cms. Maybe you could post the gc times and avg pauses, created objects (screenshots) etc here, I'm just curious Smiley
Online princec

« JGO Spiffy Duke »


Medals: 980
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #8 - Posted 2017-11-30 13:45:24 »

Currently not really up to speed on the project, being diverted. I will return to it in the next few months but will likely mention the issue again around then, as it is vexing.
I am particularly keen to try the Shenandoah GC which as I understand it is available in the OpenJDK builds.

Cas Smiley

Offline h.pernpeintner

JGO Knight


Medals: 69



« Reply #9 - Posted 2017-11-30 14:53:24 »

I am particularly keen to try the Shenandoah GC which as I understand it is available in the OpenJDK builds.

That's interesting. I thought that Shenandoah is not suitable for normal applications, as the official description states:

This is not the one GC to rule them all. If you are running with a heap of 20GB or less or if you are running with a single core, you are probably better off with one of the current GC algorithms.

Looking forward to your results.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Online princec

« JGO Spiffy Duke »


Medals: 980
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #10 - Posted 2017-11-30 15:06:43 »

We're reasonably multithreaded in some places but the heap is definitely much smaller (under 1GB). What interested me was its consistency and high speed. Maybe the serial GC is all I really need though.

Cas Smiley

Offline Spasi
« Reply #11 - Posted 2017-11-30 15:15:10 »

If you're looking to test Shenandoah on Windows, looks like it's available in the 1.8.0.151 ojdkbuild.

That's interesting. I thought that Shenandoah is not suitable for normal applications

(Low-)pause-less GCs sacrifice maximum throughput for lower latency/pauses. Shenandoah has lower throughput than G1GC, but significantly lower pauses. A real-time game would actually value low latency much more than high throughput. Afaik, Shenandoah has been shown to perform well on small heaps too. Also note that Shenandoah increases object size (Brooks pointers).

Maybe the serial GC is all I really need though.

We have apps in production capped to 512MB with SerialGC and pauses are indeed small enough that it's a good tradeoff.
Offline nsigma
« Reply #12 - Posted 2017-11-30 16:49:35 »

@princec found an old launcher with this in it, which I think is similar/same as -incgc

1  
-J-XX:+UseConcMarkSweepGC -J-XX:+CMSIncrementalMode -J-XX:+CMSIncrementalPacing


However, it looks like while CMS is still there, they've also removed the incremental pacing flags.  Maybe just try the first argument?

We have apps in production capped to 512MB with SerialGC and pauses are indeed small enough that it's a good tradeoff.

That's a good point.  I've been using the SerialGC more recently.  If you can keep the heap from growing too much it's OK.  In Praxis LIVE I have the ability to split off pipelines into child VMs - I run audio in a separate VM with SerialGC and low heap size, but then I guess my "fps" is 10x what you need!  Wink

Praxis LIVE - hybrid visual IDE for (live) creative coding
Offline gouessej
« Reply #13 - Posted 2017-11-30 23:23:11 »

If you're looking to test Shenandoah on Windows, looks like it's available in the 1.8.0.151 ojdkbuild.
Why not using adoptopenjdk.net instead?

Julien Gouesse | Personal blog | Website | Jogamp
Offline Archive
« Reply #14 - Posted 2017-12-01 03:05:32 »

So glad I switched over to C/C++

Offline nsigma
« Reply #15 - Posted 2017-12-01 08:46:48 »

Why not using adoptopenjdk.net instead?

Is Shenandoah in there? Website claims not but didn't find release notes quickly.

Thanks @Archive for the drive-by trolling!  Tongue

Praxis LIVE - hybrid visual IDE for (live) creative coding
Online princec

« JGO Spiffy Duke »


Medals: 980
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #16 - Posted 2017-12-01 09:49:49 »

So glad I switched over to C/C++
I have to use C at work every day... it's like trying to build the Taj Mahal out of matchsticks.

Cas Smiley

Pages: [1]
  ignore  |  Print  
 
 

 
Ecumene (143 views)
2017-09-30 02:57:34

theagentd (206 views)
2017-09-26 18:23:31

cybrmynd (290 views)
2017-08-02 12:28:51

cybrmynd (282 views)
2017-08-02 12:19:43

cybrmynd (292 views)
2017-08-02 12:18:09

Sralse (282 views)
2017-07-25 17:13:48

Archive (950 views)
2017-04-27 17:45:51

buddyBro (1088 views)
2017-04-05 03:38:00

CopyableCougar4 (1653 views)
2017-03-24 15:39:42

theagentd (1413 views)
2017-03-24 15:32:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!