Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (533)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 2 [3]
  ignore  |  Print  
  Garbage collector tuning  (Read 5796 times)
0 Members and 1 Guest are viewing this topic.
Offline Gudradain
« Reply #60 - Posted 2012-08-01 17:46:52 »

Seriously, I find it really strange that you get the best performance with G1 cas since that collector was designed to work with server like application using a huge amount of memory and running on multiprocessor machines.

How can that description fit a small game running on a single processor machine? For big desktop game it might be the good choice though
Offline Riven
« League of Dukes »

JGO Overlord


Medals: 743
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #61 - Posted 2012-08-01 17:53:45 »

You confuse throughput with latency.
This.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline princec

JGO Kernel


Medals: 342
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #62 - Posted 2012-08-01 20:13:45 »

Thank you Riven.

Cas Smiley

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ags1

JGO Ninja


Medals: 46
Projects: 2
Exp: 5 years


Make code not war!


« Reply #63 - Posted 2012-08-01 21:45:03 »

I wonder how much difference these abstruse considerations make in the end. Just make the game, don't do anything too daft along the way, stick to what works, if it is too slow, find the slow code and fix it. Next game.

Offline Riven
« League of Dukes »

JGO Overlord


Medals: 743
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #64 - Posted 2012-08-01 21:59:34 »

I wonder how much difference these abstruse considerations make in the end. Just make the game, don't do anything too daft along the way, stick to what works, if it is too slow, find the slow code and fix it. Next game.
I'm reasonably sure that's exactly what cas did, and ended up writing object pooling for specific cases.

I did the same, in a particle engine with both short and long living particles (each particle had a Matrix4f instance, and other shit, really heavy stuff).

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings
Offline princec

JGO Kernel


Medals: 342
Projects: 3
Exp: 16 years


Eh? Who? What? ... Me?


« Reply #65 - Posted 2012-08-02 00:15:38 »

That's exactly what I did... I wrote what I wrote, then profiled it, tuned the bits that were causing unacceptable problems, and then tweaked the VM options a bit too. And here we are.

Cas Smiley

Offline Gudradain
« Reply #66 - Posted 2012-08-02 02:39:29 »

Ok ok -_-

I guess I should restate my statement since I was wrong... I did a new benchmark with thread pooling this time. Thread are usually long lived object so they are copied back and forth by the copying collector in the young generation if you don't use thread pooling. That create some heavy burden on the GC and it garbages a lot more. Also, creating a thread and starting it take some time, so it decreases performance too. So object pooling can be useful Smiley

New statement : Don't use object pooling for young objects.

In my first benchmark, I got better result because all objects died as soon as you exited the method. All those objects were easy to garbage by the copying collector since it could just ignore them all and copy only the objects currently alive (which was nearly nothing). Also, the object pooling in that example created a lot of reference from old to young objects which is bad.

On the other hand, in the thread pool benchmark, the thread lived a long time so they were copied back in forth by the copying collector.

In regard to that, using object pooling for particle engine is probably a good idea too because the life of the particles are not so short and so they will be copied back and forth by the copying collector, fill up the young memory space and the GC will do collection a lot.

One thing to note; if you use the wrong size for your object pool you will end up with bad performance (at least for thread). So be careful about the size of your object pool.
Offline sproingie

JGO Kernel


Medals: 201



« Reply #67 - Posted 2012-08-02 03:04:39 »

Also, creating a thread and starting it take some time, so it decreases performance too. So object pooling can be useful Smiley

I presume you meant thread pooling.  Threads, filehandles, and DB connections are definitely expensive resources that should always be pooled unless you have a really compelling reason not to.  For threads, best advice I can give is don't mess with threads directly.  There's a rich set of concurrency stuff in java.util.concurrent, and even more if you branch out to third-party things like Kilim, Finagle, and Akka.
Offline Roquen
« Reply #68 - Posted 2012-08-02 11:38:41 »

Since there's somewhere between 600-700 GC related tuneable sets...GC tweaking is a good candidate for a wiki page.  For instance it seems like using NUMA could be interesting for multithreaded games.
Pages: 1 2 [3]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

pw (26 views)
2014-07-24 01:59:36

Riven (25 views)
2014-07-23 21:16:32

Riven (20 views)
2014-07-23 21:07:15

Riven (22 views)
2014-07-23 20:56:16

ctomni231 (51 views)
2014-07-18 06:55:21

Zero Volt (46 views)
2014-07-17 23:47:54

danieldean (37 views)
2014-07-17 23:41:23

MustardPeter (40 views)
2014-07-16 23:30:00

Cero (57 views)
2014-07-16 00:42:17

Riven (55 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!