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

在for循环中使用RapidImageLoader加载本地图片,出现内存溢出问题 #22

Open
jaffwu opened this issue Jan 12, 2018 · 1 comment

Comments

@jaffwu
Copy link

jaffwu commented Jan 12, 2018

01-12 17:45:17.383 29243-31124 E/dalvikvm-heap: Out of memory on a 3686416-byte allocation.
01-12 17:45:17.383 29243-31124 I/dalvikvm: "pool-1-rapidview_thread_pool-thread-17" prio=1 tid=20 RUNNABLE
01-12 17:45:17.383 29243-31124 I/dalvikvm: | group="main" sCount=0 dsCount=0 obj=0x42ca65b8 self=0x6b8e1fc8
01-12 17:45:17.383 29243-31124 I/dalvikvm: | sysTid=31124 nice=19 sched=0/0 cgrp=apps/bg_non_interactive handle=1792847824
01-12 17:45:17.383 29243-31124 I/dalvikvm: | state=R schedstat=( 0 0 0 ) utm=36 stm=2 core=0
01-12 17:45:17.383 29243-31124 I/dalvikvm: at android.graphics.BitmapFactory.nativeDecodeByteArray(Native Method)
01-12 17:45:17.383 29243-31124 I/dalvikvm: at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:500)
01-12 17:45:17.383 29243-31124 I/dalvikvm: at android.graphics.BitmapFactory.decodeByteArray(BitmapFactory.java:523)
01-12 17:45:17.383 29243-31124 I/dalvikvm: at com.tencent.rapidview.utils.RapidImageLoader.getRapid(RapidImageLoader.java:281)
01-12 17:45:17.383 29243-31124 I/dalvikvm: at com.tencent.rapidview.utils.RapidImageLoader.access$200(RapidImageLoader.java:35)
01-12 17:45:17.383 29243-31124 I/dalvikvm: at com.tencent.rapidview.utils.RapidImageLoader$1.run(RapidImageLoader.java:162)
01-12 17:45:17.383 29243-31124 I/dalvikvm: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
01-12 17:45:17.383 29243-31124 I/dalvikvm: at java.util.concurrent.FutureTask.run(FutureTask.java:237)
01-12 17:45:17.383 29243-31124 I/dalvikvm: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
01-12 17:45:17.383 29243-31124 I/dalvikvm: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
01-12 17:45:17.383 29243-31124 I/dalvikvm: at java.lang.Thread.run(Thread.java:841)
01-12 17:45:17.383 29243-31124 D/skia: --- decoder->decode returned false

@Earlonus
Copy link
Collaborator

Earlonus commented Jan 15, 2018

感谢反馈,本地已经修复,外网验证后再提交上来。

RapidPool的中对文件byte[]流缓存本意是对.lua或.xml等影响加载速度的极小文件进行缓存,提高加载速度而又对内存占用影响微乎其微。

而消耗大量内存资源的图片,建议采用glide等图片缓存库封装成控件展示。

本地修改尝试跳过了对图片的缓存,验证后提交上来。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants