>> I have an application that opens, inspects, and closes many images using
>> im_open with the "rd" mode. I just updated to VIPS 7.28.9. Now I find
>> that my application aborts due to too many open file descriptors.
>>
>> It seems that VIPS is not properly closing the file descriptors associated
>> with a VipsImage.
>
> vips has an operation cache now: it keeps the most recent few
> operations alive in case you need them again.
>
> It tries to limit the cache by keeping memory under 100mb, files
> descriptors under 100, and operations cached under 10,000. But
> unfortunately it can only track file descriptors and memory it
> allocates itself. If an image load library opens a file, vips doesn't
> know about it and doesn't try to use that to trim the cache.
>
> A simple fix would be to turn down the max number of operations vips
> caches. You can control this with:
>
> vips_cache_set_max(100);
>
> http://www.vips.ecs.soton.ac.uk/supported/7.28/doc/html/libvips/VipsOperation.html#vips-cache-set-max
>
> I'll try to think of a better solution to this one :-(
It seems that I have to call vips_cache_set_max() after the fact---that
is, after a close---in order to "flush" the cache to the limit
provided. If I call vips_cache_set_max() at the begining of my program
it does not seem to restrict future operations. Is this correct?
By "an image load library" do you mean loading any image other than VIPS'
native format?
--
Mike
:wq
|