Bug 791398: Lower the default sample size to prevent OOMs. r=BenWa
authorChris Jones <jones.chris.g@gmail.com>
Mon, 24 Sep 2012 15:38:07 -0700
changeset 108059 74408f5b036afe4821308a6b54e595c3ca5bd142
parent 108058 32d1752fb7ba984f949e7cc9ab697a1d4b153047
child 108060 072674dbb5c7fefb95e2a6aa92b5e5c6fecd88b3
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewersBenWa
bugs791398
milestone18.0a1
Bug 791398: Lower the default sample size to prevent OOMs. r=BenWa
tools/profiler/sps_sampler.h
--- a/tools/profiler/sps_sampler.h
+++ b/tools/profiler/sps_sampler.h
@@ -71,17 +71,29 @@ extern bool stack_key_initialized;
 #elif defined(_M_IX86) || defined(__i386__) || defined(__i386)
 #define V8_HOST_ARCH_IA32 1
 #elif defined(__ARMEL__)
 #define V8_HOST_ARCH_ARM 1
 #else
 #warning Please add support for your architecture in chromium_types.h
 #endif
 
-#define PROFILE_DEFAULT_ENTRY 1000000
+/* FIXME/bug 789667: memory constraints wouldn't much of a problem for
+ * this small a sample buffer size, except that serializing the
+ * profile data is extremely, unnecessarily memory intensive. */
+#ifdef MOZ_WIDGET_GONK
+# define PLATFORM_LIKELY_MEMORY_CONSTRAINED
+#endif
+
+#ifndef PLATFORM_LIKELY_MEMORY_CONSTRAINED
+# define PROFILE_DEFAULT_ENTRY 1000000
+#else
+# define PROFILE_DEFAULT_ENTRY 100000
+#endif
+
 #ifdef ANDROID
 // We use a lower frequency on Android, in order to make things work
 // more smoothly on phones.  This value can be adjusted later with
 // some libunwind optimizations.
 // In one sample measurement on Galaxy Nexus, out of about 700 backtraces,
 // 60 of them took more than 25ms, and the average and standard deviation
 // were 6.17ms and 9.71ms respectively.