Skip to content

Commit 0acbc0a

Browse files
author
Hideki Itakura
committed
To reduce peak memory usage, Call RevisionInternal.Body.comact() to release document object
1 parent c77fc15 commit 0acbc0a

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/main/java/com/couchbase/lite/replicator/PullerInternal.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -620,12 +620,12 @@ public void onCompletion(HttpResponse httpResponse, Object result, Throwable e)
620620
Map<String, Object> properties = (Map<String, Object>) result;
621621
PulledRevision gotRev = new PulledRevision(properties);
622622
gotRev.setSequence(rev.getSequence());
623-
624-
//if(gotRev.getBody() != null)
625-
// gotRev.getBody().compact();
626-
623+
627624
Log.d(Log.TAG_SYNC, "%s: pullRemoteRevision add rev: %s to batcher: %s", PullerInternal.this, gotRev, downloadsToInsert);
628625

626+
if(gotRev.getBody() != null)
627+
gotRev.getBody().compact();
628+
629629
// Add to batcher ... eventually it will be fed to -insertRevisions:.
630630
downloadsToInsert.queueObject(gotRev);
631631
}

0 commit comments

Comments
 (0)