Giter VIP home page Giter VIP logo

Comments (4)

Gru110110110 avatar Gru110110110 commented on May 29, 2024

几张照片一下子加载到内存并压缩肯定会导致内存的大量使用的。 发生崩溃了吗?能否贴出崩溃日志?

from biscuit.

Bobyang912 avatar Bobyang912 commented on May 29, 2024

崩溃的情况是我猜测那些内存比较小的或者老款机型,手里的机器没出现,可能是你已经做了优化,这个不好意思,没出现的情况说出来有误导嫌疑了。只是出现因为内存原因导致压缩失败的,这种情况有办法解决么

from biscuit.

Bobyang912 avatar Bobyang912 commented on May 29, 2024

还有,我就算只选取一张图片做压缩,内存还是飙升的厉害,就是跑的你的这个demo

from biscuit.

Gru110110110 avatar Gru110110110 commented on May 29, 2024

崩溃应该是不会发生的。最多是没有足够内存导致压缩失败。内存问题,特别大的图片加载到内存是没法避免压缩失败的。你可以在压缩监听里面 回收一下内存。 因为内存回收靠系统。在压缩成功的监听回调中调用以下代码回收内存:

 Runtime.getRuntime().gc();
                try {
                    Thread.sleep(100);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.runFinalization();

from biscuit.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.