| commit | bdf5fa3434a8486388c2bca847ab6cea3259e8b9 | [log] [tgz] |
|---|---|---|
| author | Jan Sebechlebsky <jsebechlebsky@google.com> | Mon Apr 17 11:51:40 2023 +0200 |
| committer | Jan Sebechlebsky <jsebechlebsky@google.com> | Mon Apr 17 11:51:40 2023 +0200 |
| tree | 40be8ce4eddaffc495047c01d0a17bc08aff284f | |
| parent | 1180a7f1493f61f737b2a23887e3fa0e1717e1ec [diff] |
Do not preallocate memory in default constructor of {Int,Long}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: Ic852ef5e44678bbaf1dec721f8bdf8d0e88c800e