Following up on Todd's question; I work on the same team, so can answer your question before West Coast America wakes up...
Our document model is each user "project" is backed by a CBL database. Typically a user might have less than a dozen "projects" but it is conceivable to have as many as a hundred on an iOS device. Our UI presents each project as a cell in a UICollectionView and we assumed that opening each database to gather some display information, AND THEN RELEASING all references to the database would not put us in a position of burning large quantities of RAM, but we found that large numbers of projects on low RAM iOS devices are a real problem for us. Once a user has interacted with the grid-view, and chosen a project to open, we only deal with content from that one single database, and since our app is somewhat RAM intensive by its nature, at this point we REALLY don't want to pay for the RAM burden from the previous databases that were only opened to present a list of projects. A -close method on a CBLDatabase would be very helpful to us. Public access to -allOpenDatabases (currently in CBLManager+Internal.h) would be handy as well, so we could ensure all open databases were closed before opening a single database for an edit session on a project. -- Tim Gogolin On Friday, August 22, 2014 6:18:44 PM UTC-5, Jens Alfke wrote: > > > On Aug 22, 2014, at 1:35 PM, Todd Orler <[email protected] <javascript:>> > wrote: > > We’ve recently been investigating memory usage of our iOS app, and > discovered that when using the CBLManager sharedInstance, opening lots of > databases, and then closing them (releasing the refs to them), the SQLite > page cache memory is not released for those previously opened databases. > > > CBLDatabases don't close when you release your refs to them; they only > close when the CBLManager is closed. > > (Basically, "opening lots of databases" wasn't seen as a common operation. > We expected the typical use case to be that you open one or a few databases > and keep using them.) > > What's your use case for opening lots of databases? I can add a -close > method if it's important, I'm just curious why you need a lot of dbs. > > —Jens > -- You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/c73d6e30-3c81-473a-bfab-8bf8095037ac%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
