From 41010e55e9186dbaf2ca5b2cac9ea26eba07ba8b Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Mon, 24 Sep 2012 15:38:07 -0700 Subject: [PATCH] Bug 791398: Lower the default sample size to prevent OOMs. r=BenWa --- tools/profiler/sps_sampler.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/profiler/sps_sampler.h b/tools/profiler/sps_sampler.h index dcead719cda..a7d0646d505 100644 --- a/tools/profiler/sps_sampler.h +++ b/tools/profiler/sps_sampler.h @@ -76,7 +76,19 @@ extern bool stack_key_initialized; #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