Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I've written games in Java and .NET and never found this to be a big problem. I expect your "horror stories" are based on the garbage collectors of many years ago - the technology really has moved a long way since then.</p> <p>The only thing I would hesitate to use Java/.NET for on the the basis of garbage collection would be something like embedded programming with hard real time constraints (e.g. motion controllers).</p> <p>However you do need to be aware of GC pauses and all of the following can be helpful in minimising the risk of GC pauses:</p> <ul> <li>Minimise new object allocations - while object allocations are extremely fast in modern GC systems, they do contribute to future pauses so should be minimised. You can use techniques like pre-allocating arrays of objects, keeping object pools or using unboxed primitives.</li> <li>Use specialized low-latency libraries such as <a href="http://javolution.org/" rel="noreferrer">Javalution</a> for heavily used functions and data types. These are designed specifically for real-time / low latency application</li> <li>Make sure you are using the best GC algorithm when there are multiple versions available. I've heard good things about the <a href="http://developers.sun.com/learning/javaoneonline/j1sessn.jsp?sessn=TS-5419&amp;yr=2008&amp;track=javase" rel="noreferrer">Sun G1 Collector</a> for low latency applications. The best GC systems do most of their collections concurrently so that garbage collections do not have to "stop the world" for very long if at all.</li> <li>Tune the GC parameters appropriately. Usually there is a trade-off between overall performance and pause times, you may want to improve the latter at the expense of the former.</li> </ul> <p>If you're very rich, you can of course buy machines with <a href="http://www.azulsystems.com/" rel="noreferrer">hardware GC support</a>. :-)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload