While debugging my Android app at certain point I'm seeing a huge amount of entries in the LogCat with the
Tag: TextLayoutCache Text: Cache Value 0x51b9f578 deleted, size=168 (the hexa value changes from entry to entry)
Does anyone know what this about? Memory leak? Any ideas how to solve it if it is a problem? Thanks!
There doesn't seem to be a definitive answer on the net, so I had a look at the code for TextLayoutCache.cpp. Looks fine to me. It's caching text layout data to improve performance, and there's currently a fixed default cache size of 0.5MB defined in TextLayoutCache.h.
So if you're changing layout text to a fixed set of values (<0.5MB), you won't see the log message.
If you change text to dynamic values then eventually the cache will fill and the LRU (least recently used) cache entry is deleted, and you'll see the log message. It's just a debug message, not an error, not a leak. It's a useful performance metric about how Android internals are handling our App.
Note that TextLayoutCache isn't used in Android versions >= 5.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With