View Single Post
Old 01-22-2011, 04:00 PM   #18
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,484
Karma: 28005164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Hmm after spending all morning on this, I think I have it nailed down, after the first couple of switches, you should only see memory increases of 2-3MB per switch, which means that the in memory cache of metadata is not leaking any more. There are probably some still some small leaks left, but I don't care enough to fix those.

@GRiker: Could you test please as the last time I thought this was fixed, it wasn't. I've committed the fix.

You will see the mem increase by a lot the first couple of switches (depending on the relative sizes of the libraries), but after that it shouldn't increase by more than 2-3MB per switch.

Here is what I get switching between two similar sized libraries:

before: 805.37109375
after: 827.1015625
before: 827.1015625
after: 828.51171875
before: 828.55078125
after: 831.703125
before: 831.703125
after: 831.703125
before: 831.703125
after: 832.53125
before: 832.53125
after: 832.53125

Ignore the actual numbers (they are an artifact of how I'm measuring memory consumption), focus on the changes. Before is before the memory switch was started, after is after it was completed.
kovidgoyal is offline   Reply With Quote