Merge pull request #920
[mono.git] / mono / metadata / sgen-conf.h
index 2eb703e9abc0f2457bd70ff27784b5be58833c6e..d22d92130ea4591deaf22bb44e7e96fdf598d91a 100644 (file)
@@ -37,7 +37,7 @@ typedef guint64 mword;
  * Turning on heavy statistics will turn off the managed allocator and
  * the managed write barrier.
  */
-//#define HEAVY_STATISTICS
+// #define HEAVY_STATISTICS
 
 /*
  * Define this to allow the user to change the nursery size by
@@ -57,10 +57,24 @@ typedef guint64 mword;
 
 /*
  * The binary protocol enables logging a lot of the GC ativity in a way that is not very
- * intrusive and produce a compact file that can be searched using a custom tool.
- *
+ * intrusive and produces a compact file that can be searched using a custom tool.  This
+ * option enables very fine-grained binary protocol events, which will make the GC a tiny
+ * bit less efficient even if no binary protocol file is generated.
+ */
+//#define SGEN_HEAVY_BINARY_PROTOCOL
+
+/*
+ * This enables checks whenever objects are enqueued in gray queues.
+ * Right now the only check done is that we never enqueue nursery
+ * pointers in the concurrent collector.
+ */
+//#define SGEN_CHECK_GRAY_OBJECT_ENQUEUE
+
+/*
+ * This keeps track of where a gray object queue section is and
+ * whether it is where it should be.
  */
-//#define SGEN_BINARY_PROTOCOL
+//#define SGEN_CHECK_GRAY_OBJECT_SECTIONS
 
 /*
  * Define this and use the "xdomain-checks" MONO_GC_DEBUG option to
@@ -68,7 +82,23 @@ typedef guint64 mword;
  */
 //#define XDOMAIN_CHECKS_IN_WBARRIER
 
-#ifndef SGEN_BINARY_PROTOCOL
+/*
+ * Define this to get number of objects marked information in the
+ * concurrent GC DTrace probes.  Has a small performance impact, so
+ * it's disabled by default.
+ */
+//#define SGEN_COUNT_NUMBER_OF_MAJOR_OBJECTS_MARKED
+
+/*
+ * Object layout statistics gather a histogram of reference locations
+ * over all scanned objects.  We use this information to improve GC
+ * descriptors to speed up scanning.  This does not provide any
+ * troubleshooting assistance (unless you are troubled in highly
+ * unusual ways) and makes scanning slower.
+ */
+//#define SGEN_OBJECT_LAYOUT_STATISTICS
+
+#ifndef SGEN_HEAVY_BINARY_PROTOCOL
 #ifndef HEAVY_STATISTICS
 #define MANAGED_ALLOCATION
 #ifndef XDOMAIN_CHECKS_IN_WBARRIER
@@ -88,7 +118,7 @@ typedef guint64 mword;
  * Maximum level of asserts to enable on this build.
  * FIXME replace all magic numbers with defines.
  */
-#define SGEN_MAX_ASSERT_LEVEL 2
+#define SGEN_MAX_ASSERT_LEVEL 5
 
 
 #define GC_BITS_PER_WORD (sizeof (mword) * 8)
@@ -130,22 +160,6 @@ typedef guint64 mword;
 #define SGEN_MAX_NURSERY_WASTE 512
 
 
-/* This is also the MAJOR_SECTION_SIZE for the copying major
-   collector */
-#define SGEN_PINNED_CHUNK_SIZE (128 * 1024)
-
-/*
- * Number of entries of a sequential store buffer.
- * This number represents how frequently we'll have to alloc
- * a new buffer, so it's a tradeoff of potential wasted space and
- * increased performance.
- * 
- * The current value of 1024 was probably selected because it fits a x86 page.
- * There's no history on the why's of this value besides this.
- */
-#define DEFAULT_REMSET_SIZE 1024
-
-
 /*
  * Minimum allowance for nursery allocations, as a multiple of the size of nursery.
  *
@@ -175,4 +189,19 @@ typedef guint64 mword;
 #define SGEN_MIN_SAVE_TARGET_RATIO 0.1
 #define SGEN_MAX_SAVE_TARGET_RATIO 2.0
 
+/*
+ * Configurable cementing parameters.
+ *
+ * The hash table size should be a prime.  If there are too many
+ * pinned nursery objects with many references from the major heap,
+ * this number must be increased.
+ *
+ * The threshold is the number of references from the major heap to a
+ * pinned nursery object which triggers cementing: if there are more
+ * than that number of references, the pinned object is cemented until
+ * the next major collection.
+ */
+#define SGEN_CEMENT_HASH_SIZE  61
+#define SGEN_CEMENT_THRESHOLD  1000
+
 #endif