Giter Site home page Giter Site logo

Disk cache can exceed 60MB about clover HOT 5 CLOSED

chandevel avatar chandevel commented on May 25, 2024
Disk cache can exceed 60MB

from clover.

Comments (5)

floens avatar floens commented on May 25, 2024

Clover uses two kinds of file loading:

The first is Volley that is used to load thumbnails and json data. This works by loading the data into memory and when it's done loading put in in a file (cache/volley). Volley currently purges files from memory after the size has exceeded 8MB, and purges files from disk if that exceeds 10MB. Volley also limits the keeps the amount of files under 250. (250 thumbnails are almost always under 10MB).

And there is the FileCache. FileCache straight up loads files from the network to the disk, and does not keep the files into memory. FileCache is used when loading full size images. These images can get up to 8MB in size. Lower end devices cannot load these files into memory so that's why it is loading directly tot the disk. FileCache keeps the disk size under 50MB.

Now the total size shouldn't exceed 60MB, but due to a bug in Ion not keeping it's own cache down (Ion is used in FileCache) it may exceed 60MB. The current workaround is to purge the Ion cache on startup.

I'm going to remove Ion as a file loader and use something that loads files from the network and only that. I chose Ion initially because I wanted to load bitmaps with it too, but that's unnecessary now.

I'll keep this issue open until Ion is replaced and the cache size stays below 60MB.

from clover.

tadev avatar tadev commented on May 25, 2024

Thanks for the explanation. Although an option in the settings to disable disk caching altogether would be awesome, if you got the time 👍 keep it up!

from clover.

floens avatar floens commented on May 25, 2024

Disabling the disk caching is impossible. Why would you want it disabled?

from clover.

tadev avatar tadev commented on May 25, 2024

No writes to internal SD in my case prolongs the lifespan. Also, maybe caching in memory could be an option for devices with more RAM. Maybe adding a wrapper over the caching stuff that allows to choose either file cache or ram cache?

(Also no traces of 4chin on storage)

from clover.

floens avatar floens commented on May 25, 2024

Replaced the image loader with okhttp

from clover.

Related Issues (20)

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.