summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author ellen.yang <ellen.yang@unisoc.com> 2023-10-12 14:20:20 +0800
committer Evan Rosky <erosky@google.com> 2023-10-26 08:24:10 -0700
commitab5714f3d9cec71fb0d1f8d0fda0aaa2886d541d (patch)
tree847b1f784a8721de345cdfd5ec7541a02d686757
parent673d557fc02baa467d9a46c15b7bfef9427b3647 (diff)
It's all dma_buf memory leaks that cause watchdog to be in D state
for a long time and trigger natvie hang. A large amount of memory enters the D state due to allocation of memory. Contains watchdog task. lowmemorykiller: Kill 'com.android.launcher3' lead to memory leak. Bug: 304887963 Test: kill launcher at the right time. Change-Id: I37badf705bd2fb62352c134e7c91999ea7ad498a
-rw-r--r--libs/WindowManager/Shell/src/com/android/wm/shell/transition/RemoteTransitionHandler.java16
1 files changed, 10 insertions, 6 deletions
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/RemoteTransitionHandler.java b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/RemoteTransitionHandler.java
index ca2c3b4fbff1..293b66084d28 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/transition/RemoteTransitionHandler.java
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/transition/RemoteTransitionHandler.java
@@ -146,13 +146,13 @@ public class RemoteTransitionHandler implements Transitions.TransitionHandler {
});
}
};
+ // If the remote is actually in the same process, then make a copy of parameters since
+ // remote impls assume that they have to clean-up native references.
+ final SurfaceControl.Transaction remoteStartT =
+ copyIfLocal(startTransaction, remote.getRemoteTransition());
+ final TransitionInfo remoteInfo =
+ remoteStartT == startTransaction ? info : info.localRemoteCopy();
try {
- // If the remote is actually in the same process, then make a copy of parameters since
- // remote impls assume that they have to clean-up native references.
- final SurfaceControl.Transaction remoteStartT =
- copyIfLocal(startTransaction, remote.getRemoteTransition());
- final TransitionInfo remoteInfo =
- remoteStartT == startTransaction ? info : info.localRemoteCopy();
handleDeath(remote.asBinder(), finishCallback);
remote.getRemoteTransition().startAnimation(transition, remoteInfo, remoteStartT, cb);
// assume that remote will apply the start transaction.
@@ -160,6 +160,10 @@ public class RemoteTransitionHandler implements Transitions.TransitionHandler {
Transitions.setRunningRemoteTransitionDelegate(remote.getAppThread());
} catch (RemoteException e) {
Log.e(Transitions.TAG, "Error running remote transition.", e);
+ if (remoteStartT != startTransaction) {
+ remoteStartT.close();
+ }
+ startTransaction.apply();
unhandleDeath(remote.asBinder(), finishCallback);
mRequestedRemotes.remove(transition);
mMainExecutor.execute(() -> finishCallback.onTransitionFinished(null /* wct */));