Welcome to MR and thanks for your post...
This issue has been discussed recently in this thread. The problem is caused by some nasty memory leaks inside the calibre conversion code that this plugin calls to get a standard format that it can scan for the isbn.
The simplest solution to this is to follow the same approach that doing conversions does and run the conversion and scan in an external worker process executable. So after each conversion the memory contents are completely released. Currently my approach has been to run as a separate thread inside the calibre exe like metadata downloads do, however this means that memory leaks and cannot be reclaimed without restarting calibre.
However I cannot make this change without changes to the calibre api. Currently it is not possible from a plugin to create jobs to run on an external process, as the list of known "things to do" that the worker executable understands is hard coded currently. It needs some extra code to allow being passed some info about calling code in a plugin.
I have asked Kovid to make this change, as there is likely other code changes that could be made to give me more reusable code that I could use to. He has only just returned from holiday so hopefully it might get done this week and then I can start rewriting this plugin.
The only other option is to fix the memory leaks. However having helped Kovid track down some memory leak issues in the metadata download over a 5 hour period one Sunday night I know just how painful and difficult this is. Plus it could well be that the issues lie in some library calibre calls or whatever. And multiply that out over the dozens of format converters and you can see why the simplest solution is to use the code the same way calibre does.
Glad you are finding the plugin useful, but in the meantime keep your batches small and use ctrl+R to restart calibre periodically when you see the impact.
|