#616: compacting/copying gc
---------------------+------------------------------------------------------
 Reporter:  allison  |       Owner:     
     Type:  roadmap  |      Status:  new
 Priority:  normal   |   Milestone:  3.0
Component:  none     |     Version:     
 Severity:  medium   |    Keywords:     
     Lang:           |       Patch:     
 Platform:           |  
---------------------+------------------------------------------------------

Comment(by whiteknight):

 I have some misgivings about the utility of a copying collector in Parrot.
 In a "normal" memory allocation system objects in memory can be allocated
 in random-sized chunks. Think about the way a program uses malloc(), to
 get various chunks that it needs for different purposes. However in
 Parrot, all our PMC objects are fixed-size, and each PMC type contains a
 fixed-size attributes structure. Some PMC types (Arrays) and our strings
 use arbitrary-sized buffers, but most do not.

 A copying collector helps to reduce memory fragmentation by copying data
 from the Fromspace into the bottom of the ToSpace to help free up large
 contiguous chunks of memory from which large buffers can be allocated. In
 Parrot for PMC allocations, this isn't necessary: Any free chunk is large
 enough to hold any PMC. We can allocate very efficiently off a free list
 and don't need to worry about PMC pools becoming fragmented. It would be a
 huge waste to implement copying/compacting for our PMC pools.

 Where we do run into a problem is in the string pools and storage
 allocations for our Array PMC types. These buffers are going to need to be
 compacted during collections to help improve allocation performance. This
 leads us to a two-stage GC: one that is non-copying for PMCs and fixed-
 size objects, and one that is compacting for the buffers.

 What I think we need to do is make a clear separation in the GC subsystem
 to show the two different parts: the fixed-size PMC/STRING header manager,
 and the arbitrary-sized buffer manager. These things should be pluggable
 independently, and one of the cores for the arbitrary-sized buffer manager
 should implement a copying/compacting collector.

-- 
Ticket URL: <https://trac.parrot.org/parrot/ticket/616#comment:3>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets

Reply via email to