Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (406)
games submitted by our members
Games in WIP (293)
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 3931 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: 438
Projects: 4


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
Projects: Revenge of the Titans, Titan Attacks, Droid Assault, and Ultratron
Online princec
« League of Dukes »

JGO Kernel


Medals: 196
Projects: 3


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

Senior Member


Medals: 5
Projects: 1



« 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: 438
Projects: 4


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
Projects: Revenge of the Titans, Titan Attacks, Droid Assault, and Ultratron
Online princec
« League of Dukes »

JGO Kernel


Medals: 196
Projects: 3


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
« 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.
Online Roquen

JGO Ninja


Medals: 66



« 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.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Try the Free Demo of Revenge of the Titans

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

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (84 views)
2013-05-17 21:29:12

alaslipknot (92 views)
2013-05-16 21:24:48

gouessej (123 views)
2013-05-16 00:53:38

gouessej (117 views)
2013-05-16 00:17:58

theagentd (127 views)
2013-05-15 15:01:13

theagentd (114 views)
2013-05-15 15:00:54

StreetDoggy (158 views)
2013-05-14 15:56:26

kutucuk (180 views)
2013-05-12 17:10:36

kutucuk (180 views)
2013-05-12 15:36:09

UnluckyDevil (187 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
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!
Page created in 0.144 seconds with 21 queries.