![]() |
#151 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 875
Karma: 2676800
Join Date: Sep 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
|
Oof, that's some high memory usage!
To be honest, the metadata.calibre file isn't really the best way to be handling metadata on device. It's bloated, and difficult to efficiently work with on device. The main reason for using it is to keep in sync with the kobo driver in Calibre. Thanks for the feedback so far. I'm trying to think of ways to better manage memory usage. EDIT: Don't worry about Quote:
Last edited by sherman; 01-02-2021 at 10:48 PM. |
|
![]() |
![]() |
![]() |
#152 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,501
Karma: 26047188
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
@sherman: Yeah, funnily enough, @pazos has spent the day dealing with similar fallouts from giant metadata caches in KOReader ;p.
It's... not fun to work with trivially once you start hitting those gigantic libraries on 512MB of RAM :/. (Hell, I remember people managing to crash 32-bit builds of Calibre because they hit 2GB of allocs ;p) |
![]() |
![]() |
Advert | |
|
![]() |
#153 | |||||
Connoisseur
![]() Posts: 88
Karma: 18
Join Date: Jun 2020
Device: Boox Note Air3, don't use my kindle anymore
|
Quote:
Quote:
ku crashes in so many different ways (inluding one where the Kobo printed out in big lettering KOBO DISCONNECTED on the ku "before connecting to calibre mostly blank page) and then the ku "disconnected" message appeared. Quote:
Quote:
Quote:
in htop when I start it with -s PERCENT_KERNEL, it appears that ku has a VIRT of ~830+M and a RES of ~200M but in all these cases, ku just disconnects before the first file was sent in calibre. these are not the case (that I first found) where files are being transferred, the memory usage explodes, htop and other operations crawl or just don't start, and kobo reboots. also, the same memory and cpu usage was also shown for the nickel process as well btw. which makes sense as ku is spawned by nickel right? and yeah, the libra has just 512M of which htop says ~480M is available |
|||||
![]() |
![]() |
![]() |
#154 | |
Connoisseur
![]() Posts: 88
Karma: 18
Join Date: Jun 2020
Device: Boox Note Air3, don't use my kindle anymore
|
Quote:
also noted about the file. I posted that also to point out that syslog is working and I am seeing the correct things :-) In any case, It's Sunday morning where I am and it's time to play games with the little one and turn into "entertainment dad"... :-) :-) Last edited by bigwoof; 01-02-2021 at 11:15 PM. |
|
![]() |
![]() |
![]() |
#155 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 875
Karma: 2676800
Join Date: Sep 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
|
Just a heads up, I've created a Github issue for this.
|
![]() |
![]() |
Advert | |
|
![]() |
#156 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 875
Karma: 2676800
Join Date: Sep 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
|
Ok, found a major culprit for memory usage. The way I have been doing cover thumbnail creation is... suboptimal.
Basically I was being "clever" by spawning thumbnail generation into it's own goroutine. Couple of problems. Book download is generally faster than cover generation, so the number of active "create thumbnail" goroutines climbs, each consuming memory. And the second problem is I never limited the number of goroutines that could be spawned. I've changed the code to wait for the goroutine to finish before continuing on to the next book. Makes the transferring book process take longer, but causes less problems. I'm going to continue seeing if I can reduce the thumbnail creation memory usage further. |
![]() |
![]() |
![]() |
#157 | |
Connoisseur
![]() Posts: 88
Karma: 18
Join Date: Jun 2020
Device: Boox Note Air3, don't use my kindle anymore
|
Quote:
|
|
![]() |
![]() |
![]() |
#158 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 875
Karma: 2676800
Join Date: Sep 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
|
I'm talking about the thumbnails used for the homescreen/library views. Calibre sends the cover as part of the metadata, so the goal is to resize them to the appropriate sizes for the Kobo software and save them, so I can release the memory ASAP.
|
![]() |
![]() |
![]() |
#159 | |
Connoisseur
![]() Posts: 88
Karma: 18
Join Date: Jun 2020
Device: Boox Note Air3, don't use my kindle anymore
|
Quote:
are the thumbnails actually stored on disk as well? can you just drop them and have the device pull it from the epub? |
|
![]() |
![]() |
![]() |
#160 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 875
Karma: 2676800
Join Date: Sep 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
|
What happens is that the kobo software extracts the cover from ebooks, and caches them to disk with a specific directory structure and filename. Basically, what KU (and the calibre kobo driver) do is pre-seed that cache with thumbnails so the kobo software doesn't have to do it.
KU actually tells calibre what size cover to send. That size is the full screen resolution used when the ereader is sleeping etc. KU then downscales the cover to match the required size for the library and grid views and saves the files. If you're curious, thumbnail cache is in .kobo-images. |
![]() |
![]() |
![]() |
#161 | |||
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
Quote:
Quote:
|
|||
![]() |
![]() |
![]() |
#162 |
Connoisseur
![]() Posts: 88
Karma: 18
Join Date: Jun 2020
Device: Boox Note Air3, don't use my kindle anymore
|
Thanks for the excellent explanations @Davidfor and @Sherman..
so would a quick fix be to have an option to not receive the thumbnails separately from calibre in addition to the kepubs/epubs themselves? Then just let the kobo device regenerate the thumbnail on its own time. This could be marked as a "enabling this will increase your memory usage. not recommended if you have a lot of books" option. The other option would be to just receive them 1 by 1 and save them to disk immediately after processing. slow and steady.. |
![]() |
![]() |
![]() |
#163 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 875
Karma: 2676800
Join Date: Sep 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
|
Quote:
|
|
![]() |
![]() |
![]() |
#164 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 316
Karma: 10215
Join Date: Apr 2009
Location: Wherever I lay my hat!
Device: Sony PRS-T3, 650 Black, 505, Kobo Glo HD Aura ONE
|
@sherman:
![]() Works perfectly for me saving the continual Micro USB wear & tear caused by cable unplugging. Now Qi card wireless charging & Wifi book transfer extending the life of my Kobo. (Had to junk an otherwise perfectly good phone for a broken Micro usb.) As always MobileRead Forums are a great resource for the less technically endowed amongst us. |
![]() |
![]() |
![]() |
#165 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 875
Karma: 2676800
Join Date: Sep 2008
Location: Taranaki - NZ
Device: Kobo Aura H2O, Kobo Forma
|
v0.5.3 Beta 1 released
Hi all, I've released a beta version of v0.5.3. Releasing as beta due to limited testing. If no issues are uncovered, I will convert to a full release.
This release is primarily aimed at reducing memory usage, which hopefully allows for larger libraries to be used. YMMV on the library size howerver. Note, books will now appear to take longer to send to the Kobo, as I've changed how the thumbnail images are created. This release also fixes a bug that didn't disable thumbnail generation when asked. As usual, this release can be found at releases page of the GitHub repository. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
PDF compressed when sent with Calibre Wireless Connection | zorrodee666 | KOReader | 1 | 03-23-2019 11:50 PM |
connecting Calibre to Calibre without wireless connection | TomSpot | Calibre Companion | 1 | 07-10-2018 07:07 AM |
Wireless connection to calibre. | sorg | Kindle Developer's Corner | 33 | 07-16-2015 12:49 PM |
Calibre Companion and wireless connection | taratears | Calibre Companion | 13 | 03-28-2015 06:32 PM |
Nook Touch/Calibre wireless connection? | tigersfan | Devices | 8 | 01-10-2012 03:51 PM |