Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

max size doesn't take in consideration minimum 4kb block size. #85

Open
hjudez opened this issue Nov 26, 2015 · 2 comments
Open

max size doesn't take in consideration minimum 4kb block size. #85

hjudez opened this issue Nov 26, 2015 · 2 comments

Comments

@hjudez
Copy link

hjudez commented Nov 26, 2015

I am using this cache to store many many small files. I set a max of 256MB but the cache grows up to more than 450MB. That's because each small file takes at least 4kb in disk. Since this is a disk cache I would assume that setting a max would take block size in consideration.

@gubatron
Copy link
Contributor

+1 for a patch if there aren't already ways to ask/set max phys size.

@swankjesse
Copy link
Collaborator

Best advice is to work-around by setting the cache size smaller. From the Javadocs:

 * <p>This cache limits the number of bytes that it will store on the
 * filesystem. When the number of stored bytes exceeds the limit, the cache will
 * remove entries in the background until the limit is satisfied. The limit is
 * not strict: the cache may temporarily exceed it while waiting for files to be
 * deleted. The limit does not include filesystem overhead or the cache
 * journal so space-sensitive applications should set a conservative limit

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

No branches or pull requests

3 participants