commit | bf8d20acb74365ce904ab86aaa3dfddad7fdb0f5 | [log] [tgz] |
---|---|---|
author | Yi-Yo Chiang <yochiang@google.com> | Sun Mar 20 17:08:36 2022 +0800 |
committer | Yi-Yo Chiang <yochiang@google.com> | Fri Apr 01 15:56:32 2022 +0800 |
tree | 4320b352ba2a09f6f930618084536794b1d5ab52 | |
parent | 9b420e664aa31109775662a6ac776c242cd9d316 [diff] |
dynsystem: Fix memory leak Right now the MemoryFile object isn't closed after use, and dangling file descriptors are leaked into memory each time a MemoryFile object is created. Replace android.os.MemoryFile with android.os.SharedMemory and use try-with-resources to auto manage the opened file descriptors and mapped memory regions. Bug: 225310919 Test: Start a DSU installation and check /proc/$pid/maps Change-Id: I15d9f658c926ef0a46fb558215bfab40f76ddc9a