Changes between Initial Version and Version 1 of GCSizeTuning

Show
Ignore:
Timestamp:
02/09/10 20:46:54 (12 years ago)
Author:
chromatic
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GCSizeTuning

    v1 v1  
     1According to reports, Microsoft's XNA framework uses the amount of memory allocated as a guide to run full GC.  Every time they've allocated a megabyte, they run the GC.  We can do something similar. 
     2 
     3Modify the "get more objects" function to: 
     4 
     5    * check the amount of memory allocated since the last GC run 
     6    * if it's less than a threshold value (defined as a C constant), allocate a new pool 
     7    * if it meets or exceeds the threshold, run a full GC 
     8 
     9Modify the "allocate a new pool" function to: 
     10 
     11    * add the size of the new pool to the "memory allocated since last full GC" 
     12 
     13Modify the "run full GC" function to: 
     14 
     15    * reset the "memory allocated since last full GC" counter to zero 
     16 
     17Find an appropriate storage location for the "memory allocated since..." counter in the GC structure somewhere. 
     18 
     19Depending on memory growth, we may need also to set a maximum memory size for Parrot to avoid unbounded growth... but that relies on us being able to detect when the internal memory overhead (highly recursive calls, for example) is significant.