View Single Post
Old 08-09-2014, 07:26 AM   #578
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
The two things are very different.

The cover caching is for performance. The device reads covers from disk and keeps them in a cache for a while. It does this the first time the book is accessed. And as the book is likely to be seen for a while as you read it, putting the cover it in the memory cache makes sense. The cover will be removed from the cache when it hasn't been used for a while and another cover needs to be loaded. I don't know how big the cache is. For the older style home screen, it appeared to hold five covers - enough for the home screen. The cache is cleared when the device is powered off as everything in memory is dropped and restarted. Not removing the cover from the cache when deleting a book is a bug. In general, not a serious bug as deleting and putting a book back on the device with a different cover before the cover is removed from the cache is not expected to be a common action.

The bookmarks is different. The device stores bookmarks for epubs in the main memory in two places; the database and an annotations file. The annotations file is created by the RMSDK. ADE creates the same file on the PC. And if you are careful, you can copy the file between the two places. When you delete a book on the device, the bookmarks are deleted from the database, but the file is not deleted. So, if you send a new book to the device with exactly the same file name and path, it will reuse the existing annotations file. As this is a file on the internal SD card, it is not affected by powering the device off. Or at least it wasn't whenever I have tested, including before writing this post.

I don't believe there is the same in-memory caching for the annotations as there is for the covers. I can't see any and advantage in having them in memory when the book isn't opened.

At the moment, there is no way to clean-up the leftover annotation files. Occasionally, I manually delete them. But, I generally do that because of the bug when reading them messes up the location and percent into chapter. Having this as part of the utilities plugin makes sense. I'll add it to my todo list.
davidfor is offline