User: Password:
Subscribe / Log in / New account

Should be: Goodnight, Perl 6.

Should be: Goodnight, Perl 6.

Posted Feb 13, 2013 22:53 UTC (Wed) by nybble41 (subscriber, #55106)
In reply to: Should be: Goodnight, Perl 6. by khim
Parent article: Chromatic: Goodnight, Parrot

There are two general ways to deal with GC pauses in programs requiring a near-realtime response. You can use a realtime GC algorithm which amortizes the GC work across all allocations and guarantees a bounded response time, or you can guarantee that there is sufficient free memory available to run the critical path without invoking the GC. The latter is most suitable when the program can expect a certain amount of idle time, e.g. between frames. It should be a simple matter of determining how much memory is needed to render a frame and then adding a call to the GC just before going idle to free at least that much space for the next frame.

Realtime GC algorithms are rare, because they're not usually required and they tend to have more overhead. While Java has System.gc(), it's apparently not very well defined (could be anything from a no-op to a stop-the-world full GC pass), and JavaScript has no standardized control over the GC at all, probably for security reasons. The end result is that while GC response time is manageable in principle, applications written in the most popular GC languages are not provided with the necessary tools for the job.

(Log in to post comments)

Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds