Skip to content

Commit 6c80944

Browse files
author
Hideki Itakura
authored
Merge pull request #1584 from couchbase/fix/1569a
Fixed #1569 - OutOfMemoryError on replication
2 parents b688b5a + a353c57 commit 6c80944

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/main/java/com/couchbase/lite/Database.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ public void databaseStorageChanged(DocumentChange change) {
821821
if (change != null &&
822822
change.getAddedRevision() != null &&
823823
change.getAddedRevision().getBody() != null)
824-
change.getAddedRevision().getBody().compact();
824+
change.getAddedRevision().getBody().compactEasy();
825825

826826
if (change.getRevisionId() != null)
827827
Log.v(Log.TAG, "---> Added: %s as seq %d",

src/main/java/com/couchbase/lite/internal/Body.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@ public Object getPropertyForKey(String key) {
164164
return theProperties.get(key);
165165
}
166166

167+
public void compactEasy() {
168+
if (this.json != null && this.object != null) {
169+
this.object = null;
170+
}
171+
}
172+
167173
public boolean compact() {
168174
try {
169175
getJson();

0 commit comments

Comments
 (0)