20,741
edits
m (→incremental GC) |
mNo edit summary |
||
| Line 1: | Line 1: | ||
{{Stub}} | {{Stub}} | ||
In a visual application like a flight simulator, the frame rate and frame latency are critical for providing a smooth and immersive experience for the end-user. In FlightGear, which uses the Nasal scripting language with a mark/sweep garbage collector, there is a potential for performance issues and stuttering due to the way the garbage collector is triggered and the way subsystems are updated. | |||
One problem with using a mark/sweep garbage collector in a visual application is that it can be triggered at the frame rate. This means that if the garbage collector runs during a frame, it can cause a delay or stutter in the frame rate, which can be noticeable to the end-user. In a flight simulator, where the frame rate needs to be high and consistent in order to provide a realistic and smooth flying experience, this can be a significant problem. | |||
Additionally, the way subsystems are updated in FlightGear, using a vector of subsystems that is traversed and updated each frame, can also cause performance issues. This approach is similar to cooperative multitasking, where each subsystem is given a chance to run and update before the next one is called. However, if one subsystem takes a long time to run (such as Nasal due to a long GC run), it can cause delays for the other subsystems, which can result in stuttering and other performance problems. | |||
Overall, the use of a mark/sweep garbage collector in FlightGear, combined with the way subsystems are updated, can lead to performance issues and stuttering that can impact the overall flying experience for end-users. To avoid these problems, it may be necessary to optimize the garbage collector or use a different approach for managing memory and updating subsystems in FlightGear. | |||
Garbage collection is a common approach to automatic memory management in programming languages. In a garbage collector, the runtime system automatically identifies which objects are no longer in use by the program and reclaims the memory used by those objects. This can help prevent memory leaks and make it easier for programmers to manage memory in their programs. | Garbage collection is a common approach to automatic memory management in programming languages. In a garbage collector, the runtime system automatically identifies which objects are no longer in use by the program and reclaims the memory used by those objects. This can help prevent memory leaks and make it easier for programmers to manage memory in their programs. | ||