Comments (4)
几张照片一下子加载到内存并压缩肯定会导致内存的大量使用的。 发生崩溃了吗?能否贴出崩溃日志?
from biscuit.
崩溃的情况是我猜测那些内存比较小的或者老款机型,手里的机器没出现,可能是你已经做了优化,这个不好意思,没出现的情况说出来有误导嫌疑了。只是出现因为内存原因导致压缩失败的,这种情况有办法解决么
from biscuit.
还有,我就算只选取一张图片做压缩,内存还是飙升的厉害,就是跑的你的这个demo
from biscuit.
崩溃应该是不会发生的。最多是没有足够内存导致压缩失败。内存问题,特别大的图片加载到内存是没法避免压缩失败的。你可以在压缩监听里面 回收一下内存。 因为内存回收靠系统。在压缩成功的监听回调中调用以下代码回收内存:
Runtime.getRuntime().gc();
try {
Thread.sleep(100);
} catch (InterruptedException e) {
e.printStackTrace();
}
System.runFinalization();
from biscuit.
Related Issues (19)
- 压缩图片有两个关键点,第一图片的大小,第二图片的质量,如果只做到第一点的话就很鸡肋 HOT 1
- 能否支持同步方式,或者跟rxjava结合使用 HOT 1
- 压缩一张图片以后,生成了20多个缓存文件 HOT 6
- Out of memory on a 207667212-byte allocation. HOT 6
- 有内存泄漏问题,不知道哪个地方? HOT 3
- can`nt save exif info! 这是什么错误 HOT 3
- 可以设置压缩后的图片尺寸吗 ???? HOT 1
- 返回的路径list<>顺序与传入的一样吗? HOT 1
- 压缩之后,反而图片变大了
- 我来看看
- 程序崩了
- 膜拜大佬
- 能否提供压缩图片的算法步骤? HOT 7
- 可否自定义文件名 HOT 2
- 批量压缩是否有个全部压缩完成的 listener HOT 3
- 算法很好,希望加入压缩到指定大小的功能 HOT 1
- 希望可以添加这个压缩,JNI调用libjpeg库压缩 HOT 1
- 使用文件原名称有问题 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from biscuit.