You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by zs...@apache.org on 2017/03/30 11:38:50 UTC
[16/30] incubator-weex git commit: * [android] fix *
https://aone.alibaba-inc.com/project/469098/issue/10392126
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f07e6f7b/android/sdk/src/main/java/com/taobao/weex/utils/WXSoInstallMgrSdk.java
----------------------------------------------------------------------
diff --git a/android/sdk/src/main/java/com/taobao/weex/utils/WXSoInstallMgrSdk.java b/android/sdk/src/main/java/com/taobao/weex/utils/WXSoInstallMgrSdk.java
index f6d2e9e..6515c41 100755
--- a/android/sdk/src/main/java/com/taobao/weex/utils/WXSoInstallMgrSdk.java
+++ b/android/sdk/src/main/java/com/taobao/weex/utils/WXSoInstallMgrSdk.java
@@ -252,8 +252,8 @@ public class WXSoInstallMgrSdk {
private final static String ARMEABI = "armeabi"; //default
private final static String X86 = "x86";
private final static String MIPS = "mips";
- private final static int ARMEABI_Size = 3645300;
- //private final static int ARMEABI_Size = 120132;
+ private final static int ARMEABI_Size = 3645308;
+ //private final static int ARMEABI_Size = 124232;
private final static int X86_Size = 4451068;
static Context mContext = null;
http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/f07e6f7b/html5/frameworks/legacy/static/life.js
----------------------------------------------------------------------
diff --git a/html5/frameworks/legacy/static/life.js b/html5/frameworks/legacy/static/life.js
index 8e9d9bb..931ba2e 100644
--- a/html5/frameworks/legacy/static/life.js
+++ b/html5/frameworks/legacy/static/life.js
@@ -42,6 +42,9 @@ export function refreshInstance (id, data) {
* @param {string} id
*/
export function destroyInstance (id) {
+ // Markup some global state in natie side
+ markupState()
+
resetTarget()
const instance = instanceMap[id]
/* istanbul ignore else */
@@ -50,5 +53,19 @@ export function destroyInstance (id) {
}
destroy(instance)
delete instanceMap[id]
+ // notifyContextDisposed is used to tell v8 to do a full GC,
+ // but this would have a negative performance impact on weex,
+ // because all the inline cache in v8 would get cleared
+ // during a full GC.
+ // To take care of both memory and performance, just tell v8
+ // to do a full GC every eighteen times.
+ const idNum = Math.round(id)
+ const round = 18
+ if (idNum > 0) {
+ const remainder = idNum % round
+ if (!remainder) {
+ notifyTrimMemory()
+ }
+ }
return instanceMap
}