如何清除充满表情字符的字体缓存? [英] How to clear font cache filled with emoji characters?
问题描述
UICollectionView
中显示了大约800个表情符号字符。 emoji UIScrollView
会滚动内存使用量增加,不会下降。我正在重复使用单元格,当单个表情符号显示800倍时,内存在滚动过程中不会增加。
编辑
添加代码示例来重现问题:
let data = Array(I am developing keyboard extension for iPhone. There is an emoji screen smilar to Apples own emoji keyboard that shows some 800 emoji characters in UICollectionView
.
When this emoji UIScrollView
is scrolled the memory usage increases and does not drop down. I am reusing cells correctly and when testing with single emoji character displayed 800 times the memory does not increase during scrolling.
Using instruments I found that there is no memory leak in my code but it seems that the emoji glyphs are cached and can take around 10-30MB of memory depending on font size (reseach shows they are actually PNGs). Keyboard extensions can use little memory before they are killed. Is there a way to clear that font cache?
Edit
Adding code example to reproduce the problem:
let data = Array("
这篇关于如何清除充满表情字符的字体缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!