20,741
edits
m (→Mark/Sweep) |
m (→Problem) |
||
| Line 2: | Line 2: | ||
= Problem = | = Problem = | ||
The [[Nasal]] language is a dynamic programming language, where memory is not manually allocated and freed by the programmer, but instead the Nasal virtual machine automatically allocates memory from so called "memory pools", every so often these memory pools must be checked, to see how many references are still reachable, so that the unreachable ones can be removed from the memory pool and/or so that memory blocks in each pool can be allocated or freed. This is called "garbage management" or "garbage collection". | The [[Nasal]] language is a dynamic programming language, where memory is not manually allocated and freed by the programmer, but instead the Nasal virtual machine automatically allocates memory from so called "memory pools", every so often these memory pools must be checked, to see how many references (i.e. objects like variables) are still reachable, so that the unreachable ones can be removed from the memory pool and/or so that memory blocks in each pool can be allocated or freed. This is called "garbage management" or "garbage collection". | ||
The current Nasal garbage collector (GC) is known to affect the frame rate in FlightGear and occasionally causes stutter (increased frame spacing) under certain circumstances. This is largely attributed to it being a fairly simple sequential [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science)#Copying_vs._mark-and-sweep_vs._mark-and-don.27t-sweep mark/sweep collector], which needs to stop all operations, mark all reachable objects and free unreachable objects in an exclusive, single-threaded, fashion. | The current Nasal garbage collector (GC) is known to affect the frame rate in FlightGear and occasionally causes stutter (increased frame spacing) under certain circumstances. This is largely attributed to it being a fairly simple sequential [http://en.wikipedia.org/wiki/Garbage_collection_(computer_science)#Copying_vs._mark-and-sweep_vs._mark-and-don.27t-sweep mark/sweep collector], which needs to stop all operations, mark all reachable objects and free unreachable objects in an exclusive, single-threaded, fashion. | ||