-
-
Notifications
You must be signed in to change notification settings - Fork 648
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
Revise libvips operation cache defaults #1585
Comments
I believe most sharp users who change the defaults do so only to disable caching entirely. https://github.com/search?q=%22sharp.cache%28false%29%22&type=Code |
@ioquatix your cache issue fyi. |
My (long-running) program regularly reports its vips memory usage as per the following example:
I am doing relatively few operations on lots of images. The cache size can rise to nearly 1000. |
Another idea: The libvips cache doesn't know about a lot of memory -- for example, if you use vips_image_new_from_memory(), it won't add that memory area to the tracked pool, and therefore it won't add to the pressure on the cache. We could add a little API to the memory tracker to let operations record "foreign" memory, ie. memory allocations which libvips knows must be there, but which are not allocated and freed via tracked_new/tracked_free. Operations like vips_image_new_from_memory() could note memory on startup, and clear it during Operations which have knowledge of foreign memory:
Can anyone think of any others? |
Actually maybe that's not a great idea. External memory could be from eg. mmap and should not be counted as a malloc. I've just dropped the default cache_max to 100 operations. |
The libvips operation cache is useful if you are doing many operations on a few images, but less useful if you are doing a few operations on many images. Web servers, for example, will often do just one or two operations on millions of images.
VIPS_SERVER
?), compile-time option or API which turns down all the defaults. It'd be handy to have a single control which set everything small.Any thoughts? Other options? My 2p would probably be option 2., but I'm very persuadable.
The text was updated successfully, but these errors were encountered: