OSDN Git Service

Increase the number of entries set aside for zygote initiating loader lists.
authorAndy McFadden <fadden@android.com>
Fri, 15 May 2009 20:44:29 +0000 (13:44 -0700)
committerAndy McFadden <fadden@android.com>
Fri, 15 May 2009 20:47:42 +0000 (13:47 -0700)
The number of classes that are present when the zygote finishes
initializing increased in donut/master, above the 2000 we currently
plan for.  Exceeding the limit reduces zygote sharing efficiency, so
this change raises the limit.

vm/oo/Class.c

index 47e2a87..00f5683 100644 (file)
@@ -151,8 +151,18 @@ Since the ultimate goal of this test is to catch an unusual situation
 may not be worth the performance hit.
 */
 
+/*
+ * Class serial numbers start at this value.  We use a nonzero initial
+ * value so they stand out in binary dumps (e.g. hprof output).
+ */
 #define INITIAL_CLASS_SERIAL_NUMBER 0x50000000
-#define ZYGOTE_CLASS_CUTOFF 2000
+
+/*
+ * Constant used to size an auxillary class object data structure.
+ * For optimum memory use this should be equal to or slightly larger than
+ * the number of classes loaded when the zygote finishes initializing.
+ */
+#define ZYGOTE_CLASS_CUTOFF 2304
 
 static ClassPathEntry* processClassPath(const char* pathStr, bool isBootstrap);
 static void freeCpeArray(ClassPathEntry* cpe);