<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:36:29 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>[OVSDB-469] Very high String allocation pressure on GC due to  org.opendaylight.ovsdb.lib.notation.Version.fromString()</title>
                <link>https://jira.opendaylight.org/browse/OVSDB-469</link>
                <project id="10158" key="OVSDB">ovsdb</project>
                    <description>&lt;p&gt;I was suprised to see the stack trace below as the top #3 memory allocator in the JFR from &lt;a href=&quot;https://jira.opendaylight.org/browse/CONTROLLER-1864&quot; title=&quot;A 8s &amp;quot;non-GC world stop JVM pause&amp;quot; during snapshot writes&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CONTROLLER-1864&quot;&gt;&lt;del&gt;CONTROLLER-1864&lt;/del&gt;&lt;/a&gt; showing up as 1 GB Total Allocation of String, that&apos;s a hell of a lot of objects for what org.opendaylight.ovsdb.lib.notation.Version.fromString() does!&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://jira.opendaylight.org/secure/ViewProfile.jspa?name=thapar&quot; class=&quot;user-hover&quot; rel=&quot;thapar&quot;&gt;thapar&lt;/a&gt; or &lt;a href=&quot;https://jira.opendaylight.org/secure/ViewProfile.jspa?name=skitt&quot; class=&quot;user-hover&quot; rel=&quot;skitt&quot;&gt;skitt&lt;/a&gt; or any other OVSDB maintainers, how about rewriting that simpler and without allocation?&lt;/p&gt;

&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;String java.lang.String.substring(int, int)	2558
CharSequence java.lang.String.subSequence(int, int)	1653
CharSequence java.util.regex.Matcher.getSubSequence(int, int)	1610
String java.util.regex.Matcher.group(int)	1610
Version org.opendaylight.ovsdb.lib.notation.Version.fromString(String)	1567
Version org.opendaylight.ovsdb.lib.schema.typed.TyperUtils.getColumnUntilVersion(Method)	857
void org.opendaylight.ovsdb.lib.schema.typed.TyperUtils.checkColumnSchemaVersion(DatabaseSchema, Method)	857
void org.opendaylight.ovsdb.lib.schema.typed.TyperUtils.access$100(DatabaseSchema, Method)	857
Object org.opendaylight.ovsdb.lib.schema.typed.TyperUtils$1.processGetColumn(Method)	768
Object org.opendaylight.ovsdb.lib.schema.typed.TyperUtils$1.invoke(Object, Method, Object[])	768
Column com.sun.proxy.$Proxy463.getLocatorColumn()	243
RemoteUcastMacs org.opendaylight.ovsdb.hwvtepsouthbound.transactions.md.HwvtepUcastMacsRemoteUpdateCommand.buildRemoteUcast(UcastMacsRemote)	243
Node org.opendaylight.ovsdb.hwvtepsouthbound.transactions.md.HwvtepUcastMacsRemoteUpdateCommand.buildConnectionNode(Collection)	243
void org.opendaylight.ovsdb.hwvtepsouthbound.transactions.md.HwvtepUcastMacsRemoteUpdateCommand.updateUcastMacsRemote(ReadWriteTransaction, Collection)	243
void org.opendaylight.ovsdb.hwvtepsouthbound.transactions.md.HwvtepUcastMacsRemoteUpdateCommand.execute(ReadWriteTransaction)	243
void org.opendaylight.ovsdb.hwvtepsouthbound.transactions.md.HwvtepOperationalCommandAggregator.execute(ReadWriteTransaction)	243
void org.opendaylight.ovsdb.hwvtepsouthbound.transactions.md.TransactionInvokerImpl.run()	243
void java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor$Worker)	243
void java.util.concurrent.ThreadPoolExecutor$Worker.run()	243
void java.lang.Thread.run()	243&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="30775">OVSDB-469</key>
            <summary>Very high String allocation pressure on GC due to  org.opendaylight.ovsdb.lib.notation.Version.fromString()</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="1" iconUrl="https://jira.opendaylight.org/images/icons/priorities/blocker.svg">Highest</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="10000">Done</resolution>
                                        <assignee username="vorburger">Michael Vorburger</assignee>
                                    <reporter username="vorburger">Michael Vorburger</reporter>
                        <labels>
                    </labels>
                <created>Thu, 20 Sep 2018 02:16:25 +0000</created>
                <updated>Mon, 12 Nov 2018 16:41:58 +0000</updated>
                            <resolved>Tue, 2 Oct 2018 17:04:06 +0000</resolved>
                                                    <fixVersion>Oxygen-SR3</fixVersion>
                    <fixVersion>Fluorine</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="64995" author="vorburger" created="Thu, 20 Sep 2018 02:19:31 +0000"  >&lt;p&gt;and the top #6 overall memory allocation, with 538 MB of int[] is this, which will also disappear together with above:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;void java.util.regex.Matcher.&amp;lt;init&amp;gt;(Pattern, CharSequence)	4943
Matcher java.util.regex.Pattern.matcher(CharSequence)	4938
Version org.opendaylight.ovsdb.lib.notation.Version.fromString(String)	2960
Version org.opendaylight.ovsdb.lib.schema.typed.TyperUtils.getColumnUntilVersion(Method)	1428
void org.opendaylight.ovsdb.lib.schema.typed.TyperUtils.checkColumnSchemaVersion(DatabaseSchema, Method)	1428
void org.opendaylight.ovsdb.lib.schema.typed.TyperUtils.access$100(DatabaseSchema, Method)	1428
Object org.opendaylight.ovsdb.lib.schema.typed.TyperUtils$1.processGetColumn(Method)	1009
Object org.opendaylight.ovsdb.lib.schema.typed.TyperUtils$1.invoke(Object, Method, Object[])	1009
Column com.sun.proxy.$Proxy463.getLogicalSwitchColumn()	385
RemoteUcastMacs org.opendaylight.ovsdb.hwvtepsouthbound.transactions.md.HwvtepUcastMacsRemoteUpdateCommand.buildRemoteUcast(UcastMacsRemote)	385
Node org.opendaylight.ovsdb.hwvtepsouthbound.transactions.md.HwvtepUcastMacsRemoteUpdateCommand.buildConnectionNode(Collection)	385
void org.opendaylight.ovsdb.hwvtepsouthbound.transactions.md.HwvtepUcastMacsRemoteUpdateCommand.updateUcastMacsRemote(ReadWriteTransaction, Collection)	385
void org.opendaylight.ovsdb.hwvtepsouthbound.transactions.md.HwvtepUcastMacsRemoteUpdateCommand.execute(ReadWriteTransaction)	385
void org.opendaylight.ovsdb.hwvtepsouthbound.transactions.md.HwvtepOperationalCommandAggregator.execute(ReadWriteTransaction)	385
void org.opendaylight.ovsdb.hwvtepsouthbound.transactions.md.TransactionInvokerImpl.run()	385
void java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor$Worker)	385
void java.util.concurrent.ThreadPoolExecutor$Worker.run()	385
void java.lang.Thread.run()	385
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="64996" author="thapar" created="Thu, 20 Sep 2018 03:03:39 +0000"  >&lt;p&gt;I believe these are from JFRs shared by E/// team? This is from HWVTEP. This column lists all macs that are available to this particular port. The way schema is designed and based on deployment, this will be every other mac in network*N where N is number of TOR devices.&lt;/p&gt;

&lt;p&gt;I am not sure if fromString is the culprit here, the string in ColumnVersion will be something like 1.7.12, it is literally the schema version string. It is the data in this column that can grow huge.&lt;/p&gt;

&lt;p&gt;Are we sure it is the fromVersion that is doing huge allocation and not contents of column itself?&lt;/p&gt;</comment>
                            <comment id="64997" author="vorburger" created="Thu, 20 Sep 2018 03:43:01 +0000"  >&lt;p&gt;Yes,&#160;JFRs shared by E/// team (&lt;a href=&quot;https://jira.opendaylight.org/browse/CONTROLLER-1864&quot; title=&quot;A 8s &amp;quot;non-GC world stop JVM pause&amp;quot; during snapshot writes&quot; class=&quot;issue-link&quot; data-issue-key=&quot;CONTROLLER-1864&quot;&gt;&lt;del&gt;CONTROLLER-1864&lt;/del&gt;&lt;/a&gt;), and Yes the wait I interpret the stack trace shown it&apos;s the fromVersion that is doing huge allocation .. I&apos;m not sure what exactly you mean by &quot;contents of column itself&quot;, but the stack trace which I see in JMC (above) should look different if it wasn&apos;t about the allocation in fromVersion? At the worst, the change I just proposed (&lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/76290/)&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;c/76290)&lt;/a&gt;&#160;cannot hurt, and should more that looks different in a future JFR.&lt;/p&gt;</comment>
                            <comment id="64998" author="thapar" created="Thu, 20 Sep 2018 03:51:28 +0000"  >&lt;p&gt;Then something else is wrong. FromVersion can&apos;t and shouldn&apos;t be doing huge allocations coz version string will never be anything bigger than &apos;xxx.yyy.zzz&apos;. How can a string like that cause huge allocations?&lt;/p&gt;

&lt;p&gt;For every table and column in OVSDB we define a from,to versions &lt;span class=&quot;error&quot;&gt;&amp;#91;e.g. 1.0.0, 2.0.0&amp;#93;&lt;/span&gt; to determine if a given switch supports a given column or not. This caode is just to check if column is supported or not. This simple version comparison to see if column falls within range or not.&lt;/p&gt;

&lt;p&gt;If issue were too many small allocations, I&apos;d understand, but huge allocation is just not possible here. We&apos;re missing something significant.&lt;/p&gt;</comment>
                            <comment id="64999" author="vorburger" created="Thu, 20 Sep 2018 03:59:01 +0000"  >&lt;p&gt;Nope, as a wrote, the issue is 1 GB but not of a huge String (I never said that, you interpreted) of many small, substring() String; specifically x3 for each part of the Version. What is the harm in getting&#160;c/76290 merged and seeing? It cannot hurt, at worst you are right and it doesn&apos;t help, at best I&apos;m right and this overallocation disappears. Worth a try!&lt;/p&gt;</comment>
                            <comment id="65000" author="thapar" created="Thu, 20 Sep 2018 04:15:51 +0000"  >&lt;p&gt;Aha, makes sense. Sorry for confusion.&lt;/p&gt;

&lt;p&gt;Trading allocation for performance hit which definitely will be there? There is a reason pattern was used in first place. I&apos;d prefer running tests with a distribution zip off the patch, getting results before we merge.&lt;/p&gt;

&lt;p&gt;Worst case is not that this doesn&apos;t help. Worst case is it makes everything too slow and scale numbers get even worse.&lt;/p&gt;

&lt;p&gt;EDIT:&lt;br/&gt;
Am trying to come up with a patch that can significantly reduce the number of times this method needs to be called to the point where we won&apos;t end up with so huge allocation. I think I might be able to figure out a redesign that will give best results.&lt;/p&gt;</comment>
                            <comment id="65006" author="vorburger" created="Thu, 20 Sep 2018 15:36:39 +0000"  >&lt;p&gt;&amp;gt;&#160;performance hit which definitely will be there? There is a reason pattern was used in first place.&lt;/p&gt;

&lt;p&gt;What? What makes you say that? The change proposed in &lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/76290/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;c/76290&lt;/a&gt;&#160;will, if anything, make Version fromString() faster, not slower... FYI that&#160;parse() method is directly inspired by JDK&apos;s&#160;Integer.parseInt.&#160;&#160;&lt;a href=&quot;https://jira.opendaylight.org/secure/ViewProfile.jspa?name=skitt&quot; class=&quot;user-hover&quot; rel=&quot;skitt&quot;&gt;skitt&lt;/a&gt; perhaps you would like to weight in here?&#160;&lt;img class=&quot;emoticon&quot; src=&quot;https://jira.opendaylight.org/images/icons/emoticons/biggrin.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;

&lt;p&gt;&amp;gt;&#160;I&apos;d prefer running tests with a distribution zip off the patch, getting results before we merge&lt;/p&gt;

&lt;p&gt;sure, always a good idea, can you CSIT it? Shout if anything broken (due to this), doubt it.&lt;/p&gt;</comment>
                            <comment id="65008" author="skitt@redhat.com" created="Fri, 21 Sep 2018 08:28:08 +0000"  >&lt;p&gt;I think Michael&#8217;s patch is definitely worth it, thanks. It&#8217;s a shame parseInt() can&#8217;t deal with substring parsing itself! NumberFormat can, but it&#8217;s too expensive.&lt;/p&gt;</comment>
                            <comment id="65162" author="vorburger" created="Tue, 2 Oct 2018 16:32:17 +0000"  >&lt;p&gt;I&apos;ve back-ported (manual cherry-pick and conflict resolution) &lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/76290/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/76290/&lt;/a&gt;&#160;from Neon master to Fluorine (&lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/76568)&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/76568)&lt;/a&gt;&#160;and Oxygen (&lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/76569&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/76569&lt;/a&gt;).&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10003">
                    <name>Relates</name>
                                            <outwardlinks description="relates to">
                                        <issuelink>
            <issuekey id="30774">CONTROLLER-1864</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </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_10202" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Priority</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10313"><![CDATA[Highest]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i03iy7:</customfieldvalue>

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