You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Michael Dürig (JIRA)" <ji...@apache.org> on 2017/04/20 12:32:04 UTC

[jira] [Commented] (OAK-6110) Offline compaction uses too much memory

    [ https://issues.apache.org/jira/browse/OAK-6110?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15976606#comment-15976606 ] 

Michael Dürig commented on OAK-6110:
------------------------------------

Test case in http://svn.apache.org/viewvc?rev=1792048&view=rev.

{{ManyChildNodesIT.manyChildNodesOC()}} adds 2M direct child nodes to the root and runs offline compaction subsequently. This  takes a long time due to memory pressure and might eventually go OOM (with {{-Xmx512m}}). 

> Offline compaction uses too much memory 
> ----------------------------------------
>
>                 Key: OAK-6110
>                 URL: https://issues.apache.org/jira/browse/OAK-6110
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: segment-tar
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>              Labels: memory, performance
>             Fix For: 1.7.0, 1.8
>
>
> Using offline compaction on a repository with nodes having many direct child node I observed a steady increase of heap usage. This is cause by using a {{MemoryNodeBuilder}} in {{CompactDiff.childNodeAdded()}}, which causes all those child nodes to be cached in memory. 
> Changing the line
> {code}
> child = EMPTY_NODE.builder();
> {code}
> to 
> {code}
> child = writer.writeNode(EMPTY_NODE).builder();
> {code}
> fixes the problem as the latter returns a {{SegmentNodeBuilder}} where the former returns a {{MemoryNodeBuilder}}.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)