Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e59f2a2c authored by Shai Barack's avatar Shai Barack
Browse files

Introduce JniStringCache to cache jstring instances.

This change adds a native cache of jstrings created from native strings.
The goal is to reduce duplicate java.lang.String instances.
Demonstrate usage, and test correctness, by integrating with Parcel.
On background trim (sent just before transition GC prior to freeze), clear the cache to maximize potential GC returns.

Running this on my local device, producing stats from dumpsys meminfo, and processing them, I get:
https://docs.google.com/spreadsheets/d/1tVvMROAOhgphJNuFZoavNh7jG0iTErUHYP2DnQnascE/edit?usp=sharing
Most processes have a >80% hit rate.

Flag: android.os.parcel_string_cache_enabled
Bug: 442140362

Change-Id: I818ad94dd90d58576f5f86bc8a5c6d67dd5ec61a
parent 7c077e50
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment