[
https://issues.apache.org/jira/browse/OAK-10114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17700244#comment-17700244
]
Rishabh Kumar commented on OAK-10114:
-------------------------------------
On further analyzing the issue, we found that the root cause of this excessive
memory usage is that we are fetching the whole record/document into the memory,
which is unnecessary.
Since we only need the *path* of the document, I propose that we should only
fetch the relevant fields from the document store.
Currently, the
[DocumentStore|https://github.com/apache/jackrabbit-oak/blob/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentStore.java]
API doesn't allow us to use projections while fetching the records from the
database.
So, I think we should create a new API to fetch the records with only projected
fields.
This would not only help us in this case but could also help in improving other
queries which would fit into this case.
> Node diff with many changes uses excessive memory
> -------------------------------------------------
>
> Key: OAK-10114
> URL: https://issues.apache.org/jira/browse/OAK-10114
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Reporter: Rishabh Kumar
> Priority: Major
>
> Calculating the diff on a node with many changes on child nodes uses
> excessive memory. The implementation in Oak loads all NodeDocuments into
> memory that changed between two given revisions.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)