<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:55:10 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>OpenDaylight JIRA</title>
    <link>https://jira.opendaylight.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.20.10</version>
        <build-number>820010</build-number>
        <build-date>22-06-2022</build-date>
    </build-info>


<item>
            <title>[YANGTOOLS-1093] yang-model-validator tool crashes with OOM</title>
                <link>https://jira.opendaylight.org/browse/YANGTOOLS-1093</link>
                <project id="10188" key="YANGTOOLS">yangtools</project>
                    <description>&lt;p&gt;This may be user error, or maybe improperly written yang, but when I try to run the&#160; model validator against some juniper yang models from the&#160;&lt;a href=&quot;https://github.com/YangModels/yang&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;yang github repo&lt;/a&gt; the tool consumes all given memory, spikes the CPU and eventually crashes with an OOM.&lt;/p&gt;

&lt;p&gt;Command to recreate running from root of yang repo:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
java -Xmx12288m -jar ../yangtools/yang/yang-model-validator/target/yang-model-validator-5.0.0-SNAPSHOT-jar-with-dependencies.jar -p ./vendor/juniper/18.2/18.2R1/ -r -d vendor/juniper/18.2/18.2R1/junos/conf/junos-conf-root@2018-01-01.yang
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Not very helpful, but here is one OOM crash trace:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
Exception in thread &lt;span class=&quot;code-quote&quot;&gt;&quot;main&quot;&lt;/span&gt; java.lang.OutOfMemoryError: Java heap space
	at org.antlr.v4.runtime.misc.DoubleKeyMap.&amp;lt;init&amp;gt;(DoubleKeyMap.java:19)
	at org.antlr.v4.runtime.atn.ParserATNSimulator.computeReachSet(ParserATNSimulator.java:776)
	at org.antlr.v4.runtime.atn.ParserATNSimulator.execATNWithFullContext(ParserATNSimulator.java:664)
	at org.antlr.v4.runtime.atn.ParserATNSimulator.execATN(ParserATNSimulator.java:505)
	at org.antlr.v4.runtime.atn.ParserATNSimulator.adaptivePredict(ParserATNSimulator.java:393)
	at org.opendaylight.yangtools.yang.parser.antlr.YangStatementParser.statement(YangStatementParser.java:276)
	at org.opendaylight.yangtools.yang.parser.antlr.YangStatementParser.statement(YangStatementParser.java:229)
	at org.opendaylight.yangtools.yang.parser.antlr.YangStatementParser.statement(YangStatementParser.java:229)
	at org.opendaylight.yangtools.yang.parser.antlr.YangStatementParser.statement(YangStatementParser.java:229)
	at org.opendaylight.yangtools.yang.parser.antlr.YangStatementParser.statement(YangStatementParser.java:229)
	at org.opendaylight.yangtools.yang.parser.antlr.YangStatementParser.statement(YangStatementParser.java:229)
	at org.opendaylight.yangtools.yang.parser.antlr.YangStatementParser.statement(YangStatementParser.java:229)
	at org.opendaylight.yangtools.yang.parser.antlr.YangStatementParser.statement(YangStatementParser.java:229)
	at org.opendaylight.yangtools.yang.parser.rfc7950.repo.YangStatementStreamSource.parseYangSource(YangStatementStreamSource.java:171)
	at org.opendaylight.yangtools.yang.parser.rfc7950.repo.YangStatementStreamSource.create(YangStatementStreamSource.java:98)
	at org.opendaylight.yangtools.yang.parser.impl.YangParserImpl.sourceToStatementStream(YangParserImpl.java:119)
	at org.opendaylight.yangtools.yang.parser.impl.YangParserImpl.addLibSource(YangParserImpl.java:73)
	at org.opendaylight.yangtools.yang.validator.SystemTestUtils.parseYangSources(SystemTestUtils.java:103)
	at org.opendaylight.yangtools.yang.validator.SystemTestUtils.parseYangSources(SystemTestUtils.java:87)
	at org.opendaylight.yangtools.yang.validator.Main.runSystemTest(Main.java:177)
	at org.opendaylight.yangtools.yang.validator.Main.main(Main.java:136)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Notice the above command is using 12G heap size. Obviously, it&apos;s much faster to hit&lt;br/&gt;
 with a smaller heap. I will link a heap dump from a 1G recreation&lt;/p&gt;</description>
                <environment></environment>
        <key id="32556">YANGTOOLS-1093</key>
            <summary>yang-model-validator tool crashes with OOM</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.opendaylight.org/images/icons/priorities/major.svg">Medium</priority>
                        <status id="5" iconUrl="https://jira.opendaylight.org/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10001">Won&apos;t Do</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="jluhrsen">Jamo Luhrsen</reporter>
                        <labels>
                    </labels>
                <created>Tue, 31 Mar 2020 15:40:20 +0000</created>
                <updated>Wed, 28 Oct 2020 17:39:18 +0000</updated>
                            <resolved>Fri, 12 Jun 2020 17:01:12 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="68005" author="jluhrsen" created="Tue, 31 Mar 2020 23:08:14 +0000"  >&lt;p&gt;Attached is a screen shot from the yourkit profiler showing an expanded view of the objects taking 99% of allocated memory in case&lt;br/&gt;
that helps. It was taken from &lt;a href=&quot;https://drive.google.com/file/d/1YHgRiJoTqibl5QlSIcjbeN0582-1ZWkB/view?usp=sharing&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;this heap dump &lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some of the juniper models are very large and I noticed the life profiler indicated some kind fo deadlock when it noticed some threads&lt;br/&gt;
not moving and mentioned some recursion happening. Possibly if we are reading and holding on to the same large models over&lt;br/&gt;
and over in duplicate during recursion we could end up in this trouble?&lt;/p&gt;</comment>
                            <comment id="68212" author="rovarga" created="Fri, 12 Jun 2020 06:24:01 +0000"  >&lt;p&gt;The stack trace indicates &apos;addLibSource&apos;, i.e. when a source is being added to the library. We are creating an ASTSchemaSource to determine the real identifier of the source and are retaining it for future use (same as we do for normal sources).&lt;/p&gt;

&lt;p&gt;For normal sources this makes sense, as they are required and guaranteed to be touched during assembly. For library sources this is not as clear-cut, as they may or may not be referenced.&lt;/p&gt;

&lt;p&gt;We need to instantiate ASTSchemaSource lazily when it is actually needed. We also should not retain a strong reference to it, so as to allow it to be GC&apos;d if it ends up being unneeded.&lt;/p&gt;</comment>
                            <comment id="68213" author="rovarga" created="Fri, 12 Jun 2020 08:18:46 +0000"  >&lt;p&gt;This is going to take a bit more effort, as it requires reworking how SOURCE_PRE_LINKAGE phase works &#8211; which is part of &lt;a href=&quot;https://jira.opendaylight.org/browse/YANGTOOLS-1112&quot; title=&quot;Separate out ModelProcessingPhase.SOURCE_PRE_LINKAGE phase handling&quot; class=&quot;issue-link&quot; data-issue-key=&quot;YANGTOOLS-1112&quot;&gt;YANGTOOLS-1112&lt;/a&gt;. Without that refactor, any laziness in file parsing would be immediately negated by the indiscriminate loading of statements.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="68214" author="rovarga" created="Fri, 12 Jun 2020 09:04:39 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.opendaylight.org/secure/ViewProfile.jspa?name=jluhrsen&quot; class=&quot;user-hover&quot; rel=&quot;jluhrsen&quot;&gt;jluhrsen&lt;/a&gt; while this issue is a valid improvement, I think the command uses a vastly over-specified library, which pulls in a &lt;b&gt;ton&lt;/b&gt; of unrelated models &#8211; hence we should be able to limit the impact.&lt;/p&gt;</comment>
                            <comment id="68222" author="jluhrsen" created="Fri, 12 Jun 2020 17:01:05 +0000"  >&lt;p&gt;agreed. Eventually I found ways to limit unneeded models and not kill things. Something like this is in a testtool is&lt;br/&gt;
low priority and likely not anything to push for a fix at this point. Let&apos;s close it as won&apos;t do for now and if someone&lt;br/&gt;
else comes along with a need we can look again.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10300">
                    <name>Issue split</name>
                                            <outwardlinks description="split to">
                                        <issuelink>
            <issuekey id="32752">YANGTOOLS-1112</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="15625" name="YANGTOOLS-1093.jpg" size="492580" author="jluhrsen" created="Tue, 31 Mar 2020 23:02:16 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_11400" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i03rtz:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>