diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp index 6f131b908a08..43e6099b5a0c 100644 --- a/dom/ipc/ContentParent.cpp +++ b/dom/ipc/ContentParent.cpp @@ -367,20 +367,7 @@ ContentParent::Observe(nsISupports* aSubject, // listening for memory pressure event if (!strcmp(aTopic, "memory-pressure")) { - NS_ConvertUTF16toUTF8 dataStr(aData); - const char *deathPending = dataStr.get(); - - if (!strcmp(deathPending, "oom-kill")) { -#ifdef MOZ_CRASHREPORTER - nsCOMPtr cr = do_GetService("@mozilla.org/toolkit/crash-reporter;1"); - if (cr) { - cr->AnnotateCrashReport(NS_LITERAL_CSTRING("oom"), NS_LITERAL_CSTRING("true")); - } -#endif - KillProcess(OtherProcess(), 0, false); - } - else - SendFlushMemory(nsDependentString(aData)); + SendFlushMemory(nsDependentString(aData)); } // listening for remotePrefs... else if (!strcmp(aTopic, "nsPref:changed")) { diff --git a/embedding/android/GeckoApp.java b/embedding/android/GeckoApp.java index 03e3de99ce87..eefb1522112a 100644 --- a/embedding/android/GeckoApp.java +++ b/embedding/android/GeckoApp.java @@ -70,7 +70,6 @@ abstract public class GeckoApp public static GeckoApp mAppContext; public static boolean mFullscreen = false; static Thread mLibLoadThread = null; - private static MemoryWatcher mMemoryWatcher = null; enum LaunchState {PreLaunch, Launching, WaitButton, Launched, GeckoRunning, GeckoExiting}; @@ -214,8 +213,6 @@ abstract public class GeckoApp surfaceView.mSplashStatusMsg = getResources().getString(R.string.splash_screen_label); mLibLoadThread.start(); - - mMemoryWatcher = new MemoryWatcher(this); } @Override @@ -275,8 +272,6 @@ abstract public class GeckoApp // onPause will be followed by either onResume or onStop. super.onPause(); - - mMemoryWatcher.StopMemoryWatcher(); } @Override @@ -293,8 +288,6 @@ abstract public class GeckoApp if (checkLaunchState(LaunchState.PreLaunch) || checkLaunchState(LaunchState.Launching)) onNewIntent(getIntent()); - - mMemoryWatcher.StartMemoryWatcher(); } @Override @@ -353,8 +346,6 @@ abstract public class GeckoApp @Override public void onLowMemory() { - // if you change this handler, please take a look at - // MemoryWatcher too. Log.e("GeckoApp", "low memory"); if (checkLaunchState(LaunchState.GeckoRunning)) GeckoAppShell.onLowMemory(); diff --git a/embedding/android/GeckoAppShell.java b/embedding/android/GeckoAppShell.java index 7eb83f706493..a5f4c8f7176f 100644 --- a/embedding/android/GeckoAppShell.java +++ b/embedding/android/GeckoAppShell.java @@ -97,7 +97,6 @@ class GeckoAppShell public static native void putenv(String map); public static native void onResume(); public static native void onLowMemory(); - public static native void onCriticalOOM(); public static native void callObserver(String observerKey, String topic, String data); public static native void removeObserver(String observerKey); public static native void loadLibs(String apkName, boolean shouldExtract); @@ -137,7 +136,7 @@ class GeckoAppShell // On some device, we do not want to ever over-allocate. if (android.os.Build.MODEL.equals("Nexus S") == true) - GeckoAppShell.putenv("MALLOC_OPTIONS=-o"); + GeckoAppShell.putenv("MALLOC_OPTIONS=o"); File f = new File("/data/data/" + GeckoApp.mAppContext.getPackageName() + "/tmp"); diff --git a/embedding/android/Makefile.in b/embedding/android/Makefile.in index afc5c361d317..b5d0c920fb18 100644 --- a/embedding/android/Makefile.in +++ b/embedding/android/Makefile.in @@ -53,7 +53,6 @@ JAVAFILES = \ GeckoSurfaceView.java \ GeckoInputConnection.java \ AlertNotification.java \ - MemoryWatcher.java \ $(NULL) PROCESSEDJAVAFILES = \ diff --git a/other-licenses/android/APKOpen.cpp b/other-licenses/android/APKOpen.cpp index 7e9b161a2da5..d0e1818d44ad 100644 --- a/other-licenses/android/APKOpen.cpp +++ b/other-licenses/android/APKOpen.cpp @@ -236,7 +236,6 @@ SHELL_WRAPPER1(notifyGeckoOfEvent, jobject) SHELL_WRAPPER1(setSurfaceView, jobject) SHELL_WRAPPER0(onResume) SHELL_WRAPPER0(onLowMemory) -SHELL_WRAPPER0(onCriticalOOM) SHELL_WRAPPER3(callObserver, jstring, jstring, jstring) SHELL_WRAPPER1(removeObserver, jstring) SHELL_WRAPPER1(onChangeNetworkLinkStatus, jstring) @@ -667,7 +666,6 @@ loadLibs(const char *apkName) GETFUNC(setSurfaceView); GETFUNC(onResume); GETFUNC(onLowMemory); - GETFUNC(onCriticalOOM); GETFUNC(callObserver); GETFUNC(removeObserver); GETFUNC(onChangeNetworkLinkStatus); diff --git a/widget/src/android/AndroidJNI.cpp b/widget/src/android/AndroidJNI.cpp index 05155c5a3ad7..47db1f25c1d7 100644 --- a/widget/src/android/AndroidJNI.cpp +++ b/widget/src/android/AndroidJNI.cpp @@ -66,7 +66,6 @@ extern "C" { NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_setSurfaceView(JNIEnv *jenv, jclass, jobject sv); NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_onResume(JNIEnv *, jclass); NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_onLowMemory(JNIEnv *, jclass); - NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_onCriticalOOM(JNIEnv *, jclass); NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_callObserver(JNIEnv *, jclass, jstring observerKey, jstring topic, jstring data); NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_removeObserver(JNIEnv *jenv, jclass, jstring jObserverKey); NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_onChangeNetworkLinkStatus(JNIEnv *, jclass, jstring status); @@ -107,17 +106,6 @@ Java_org_mozilla_gecko_GeckoAppShell_onLowMemory(JNIEnv *jenv, jclass jc) } } -NS_EXPORT void JNICALL -Java_org_mozilla_gecko_GeckoAppShell_onCriticalOOM(JNIEnv *jenv, jclass jc) -{ - __android_log_print(ANDROID_LOG_ERROR, "GeckoAppShell", "Critical OOM reached!"); - if (nsAppShell::gAppShell) { - nsAppShell::gAppShell->NotifyObservers(nsnull, - "memory-pressure", - NS_LITERAL_STRING("oom-kill").get()); - } -} - NS_EXPORT void JNICALL Java_org_mozilla_gecko_GeckoAppShell_onResume(JNIEnv *jenv, jclass jc) { diff --git a/xpcom/base/nsIMemory.idl b/xpcom/base/nsIMemory.idl index e48a9941a93f..5f4fb892dbb5 100644 --- a/xpcom/base/nsIMemory.idl +++ b/xpcom/base/nsIMemory.idl @@ -67,12 +67,6 @@ * This will be passed as the extra data when the pressure * observer has been asked to flush because a malloc() or * realloc() has failed. - * - * "oom-kill" - * This will be passed as the extra data when the pressure - * observer notices that the application will crash or the - * system will hang if immediate steps are not taken to - * free as much as possible. */ [scriptable, uuid(59e7e77a-38e4-11d4-8cf5-0060b0fc14a3)]