Yeah, the replicator runs in a background thread that has its own database objects. The CBLReplication object you see is just a façade that communicates with the real objects (CBL_Puller and CBL_Pusher) on that thread.
It’s possible the memory usage is coming from app code that’s triggered by database-changed or document-changed notifications; or from LiveQueries, which are driven by those notifications. But it could also be a CBL bug.
— What version of CBL? Hopefully at least 1.0.3.
— How big are your documents? Attachment size shouldn’t matter, but do any of them have huge amounts of JSON?
— Does this happen with push, or pull, or both?
— How fast is the network connection between client and server? (I remember at one point there was a memory issue that only showed up with super-fast low-latency connections, because the puller could slurp in data faster than it could be saved to disk.)
Detailed investigation may require running Instruments to watch where memory’s being allocated.
—Jens