memory usage increasing during pull replication

50 views
Skip to first unread message

Jordan Wood

unread,
Dec 31, 2015, 10:50:12 AM12/31/15
to Couchbase Mobile
I have been looking at the memory usage of my app, and I discovered this situation:
  1. I reset content and settings in the simulator to see what happens when someone first opens the app on a new device
  2. I start the app, and just sit there doing nothing except replicating a DB with many thousands of small documents that are pulled from the server
The attached picture shows what I'm seeing in Xcode, which is a pretty impressive, steady increase in memory usage as the DB is pulled from the server.  I ended up at 565 MB.  When the replication stopped, my memory usage stopped increasing.

My logs are showing no activity other than couchbase pull replication activity, and since I am starting with a completely clean and new app, I am pretty confident that I am doing no other processing at this time in the app.

Do you know what could be causing this memory growth, and what next steps would you like me to take?  I can run this in instruments, but I'm a bit of a NOOB when it comes to interpreting the results.

Thanks for the help!

Jordan
memopry_usage.png

Jordan Wood

unread,
Jan 1, 2016, 10:11:47 AM1/1/16
to Couchbase Mobile
I didn't specify, I'm running Couchbase lite, version 1.1.1.

Jordan Wood

unread,
Jan 2, 2016, 1:46:51 PM1/2/16
to Couchbase Mobile
Okay, I've created a test app with just the couchbase cocoapod and the classes I use to manage replication.  I am still seeing consistent memory growth during my initial pull of data.  I am checking with my team about whether I can give you an app with the username/password for our data in it, but once that is straightened out, I can give you the test app if you want it.  I am seeing the attached heaviest stack trace in Instruments.  Let me know if there is anything else I can do, we want to start using this in our production code very soon!

Thanks,

Jordan


On Thursday, December 31, 2015 at 9:50:12 AM UTC-6, Jordan Wood wrote:
Screen Shot 2016-01-02 at 12.39.12 PM.png

Martin Rybak

unread,
Jan 4, 2016, 6:41:40 AM1/4/16
to Couchbase Mobile
I am seeing this behavior as well on CB 1.1.1 when doing an initial pull with thousands of small documents. This appears related to the following issue which is listed as fixed:

Jens Alfke

unread,
Jan 4, 2016, 1:38:04 PM1/4/16
to mobile-c...@googlegroups.com
[Hi! I’m back from vacation. Sorry for the delay.] I have to say I start out slightly skeptical of replicator-memory-leak reports because it’s quite possible for the leak to be caused by application code responding to the database changes (even if the objects leaked are created by the replicator; they do get passed via notifications to client code, which can incorrectly hang onto them.)

It would be best if you could reproduce the problem using a sample app like Grocery Sync, by pointing the database URL to your own server/db. That will confirm it’s the replicator and not your app code.

—Jens

Jordan Wood

unread,
Jan 4, 2016, 3:27:48 PM1/4/16
to Couchbase Mobile
I have a sample app which displays the behavior.  It's very simple, all it does is start continuous push and pull replications.  I'd prefer to send it to you instead of posting it here, where should I send it?

Jordan

Jens Alfke

unread,
Jan 4, 2016, 4:15:39 PM1/4/16
to mobile-c...@googlegroups.com
You can email it to me -- jens at couchbase.

--Jens
Reply all
Reply to author
Forward
0 new messages