Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

YYCache webp 内存泄漏 #5

Open
ChenYilong opened this issue Jul 17, 2019 · 1 comment
Open

YYCache webp 内存泄漏 #5

ChenYilong opened this issue Jul 17, 2019 · 1 comment
Labels
bug Something isn't working

Comments

@ChenYilong
Copy link
Member

来自 @政-打杂倒水-广州iOS :

说到YYCache。里面有一处过渡优化的
就是在释放menory cache的时候,它使用了子线程去释放。一般使用是没问题的。但是到了极端的情况下,CPU被拉满,子线程永远没有机会调用,然后主线程还一直往里面塞,最后内存爆炸被杀
当你们在一个页面大量使用webp的时候,就要留意了
在低端机比较容易出现,上下刷新的时候,容易出现
webp是一种新的图片格式,支持动态图片
另外动图可以关注一下svga,这个大小会小一点,但是cpu占用有时比较高

@ChenYilong ChenYilong added the bug Something isn't working label Jul 17, 2019
@ChenYilong
Copy link
Member Author

来自 BM-成都iOS:

/**
If `YES`, the key-value pair will be released on main thread, otherwise on
background thread. Default is NO.

@discussion You may set this value to `YES` if the key-value object contains
the instance which should be released in main thread (such as UIView/CALayer).
*/
@property BOOL releaseOnMainThread;

/**
If `YES`, the key-value pair will be released asynchronously to avoid blocking 
the access methods, otherwise it will be released in the access method  
(such as removeObjectForKey:). Default is YES.
*/
@property BOOL releaseAsynchronously;

默认子线程。可以开启主线程

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant