commit | 333d9757d2b0a06f29f3eac2d2c9e4f89b795c1e | [log] [tgz] |
---|---|---|
author | Jan Sebechlebsky <jsebechlebsky@google.com> | Wed Mar 08 15:49:18 2023 +0100 |
committer | Ján Sebechlebský <jsebechlebsky@google.com> | Thu Mar 09 17:40:10 2023 +0000 |
tree | 70ff3393cbf0ebef5165649f01d54b36c196c726 | |
parent | a27edf5a52f86c837661fb20b651b708de167941 [diff] |
Do not preallocate memory in default constructor of Sparse.*Array By heapdump examination this saves not-an-insignificant amount of memory and significant amount of allocations. Similar change was also introduced for ArrayList & HashMap implementation in JDK8. More details in go/if-xr-android-util-collections-lazy-init. Bug: 272467748 Test: Verified system server heapdump Change-Id: I849dbaa46e79eae0b61b93a7ab1f5d5ef8bfbf7f