标签:TextLayoutCache文字:高速缓存值已删除 [英] Tag: TextLayoutCache Text: Cache Value deleted
问题描述
在调试我的Android应用程序,在某一点上我看到与LogCat中巨额的条目
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!
推荐答案
似乎没有被网络上的一个明确的答案,所以我一看code的<一个href="https://android.googlesource.com/platform/frameworks/base/+/android-4.4.4_r2.0.1/core/jni/android/graphics/TextLayoutCache.cpp"相对=nofollow> TextLayoutCache.cpp 。看起来好像没什么问题。它的缓存文本布局数据,以提高性能,并有0.5MB目前在<定义的固定默认缓存大小href="https://android.googlesource.com/platform/frameworks/base/+/android-4.4.4_r2.0.1/core/jni/android/graphics/TextLayoutCache.h"相对=nofollow> TextLayoutCache.h 。
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.
所以,如果你正在改变布局文本到固定的值(小于0.5MB),你将不会看到日志信息
So if you're changing layout text to a fixed set of values (<0.5MB), you won't see the log message.
如果您改变文本的动态值,那么最终的缓存将填补和LRU(最近最少使用的)缓存条目被删除,你会看到的日志信息。这只是一个调试消息,而不是错误,不泄漏。它是关于如何Android的内部正在处理我们的应用程序的有用的性能指标。
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.
注意TextLayoutCache没有在Android的版本中使用> = 5。
Note that TextLayoutCache isn't used in Android versions >= 5.
这篇关于标签:TextLayoutCache文字:高速缓存值已删除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!