<!-- 
RSS generated by JIRA (9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b) at Mon Feb 12 10:28:31 CET 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>Magnolia - Issue tracker</title>
    <link>https://jira.magnolia-cms.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-uk</language>    <build-info>
        <version>9.4.2</version>
        <build-number>940002</build-number>
        <build-date>19-01-2023</build-date>
    </build-info>


<item>
            <title>[MGNLPER-78] Provide factory for ResultRanker per user</title>
                <link>https://jira.magnolia-cms.com/browse/MGNLPER-78</link>
                <project id="14882" key="MGNLPER">Periscope</project>
                    <description>&lt;p&gt;&lt;tt&gt;ResultRankerProvider&lt;/tt&gt; will keep a mapping of users and &lt;tt&gt;NeuralNetworkResultRanker&lt;/tt&gt;(s), as the neural network and labels are now per user.&lt;/p&gt;

&lt;p&gt;Such mapping will be created lazily upon user&apos;s first search. Problem is, how and when to clean up such mapping when a user logs out. Cleaning up is essential because,&#160;internally, &lt;tt&gt;NeuralNetworkResultRanker&lt;/tt&gt;&#160;uses &lt;tt&gt;deeplearning4j&lt;/tt&gt;&#160;which may allocate significant amounts of &quot;off-heap&quot; memory, that is not managed by the JVM (on our demo a neural network takes ~13MB per user). &lt;br/&gt;
 Removing a ranker from the mapping, makes it eligible for garbage collection which in turn should cause deeplearning4j&#8217;s memory management to deallocate unused memory.&lt;/p&gt;

&lt;p&gt;See also&#160;&lt;a href=&quot;https://deeplearning4j.org/docs/latest/deeplearning4j-config-memory&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://deeplearning4j.org/docs/latest/deeplearning4j-config-memory&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Ideally, &lt;tt&gt;NeuralNetworkResultRanker&lt;/tt&gt;&#160;should be an admincentral scoped component whose lifecycle ends with a user session but machine-learning module has no dependency on UI.&lt;/p&gt;

&lt;p&gt;One solution could be &lt;b&gt;keeping the mapping in a cache&lt;/b&gt; with a LRU eviction policy.&lt;/p&gt;

&lt;p&gt;An alternative solution would be to have &lt;b&gt;one &lt;tt&gt;Periscope&lt;/tt&gt; instance per user&lt;/b&gt; (instead of being a singleton):&lt;br/&gt;
 &lt;b&gt;PRO&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;no need to mess with keeping a map of users/rankers and clean it up&lt;/li&gt;
	&lt;li&gt;one instance of &lt;tt&gt;Periscope&lt;/tt&gt; + &lt;tt&gt;NeuralNetworkResultRanker&lt;/tt&gt; per logged in user, after logout the instances can be garbage collected and memory used by deeplearning4j freed as a consequence.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;b&gt;CONTRA&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Periscope is the entry point to the underlying search engine, so most properties of and services provided by this class are globally unique. With multiple instances, we end up with several duplicates of almost the same object with just a different ranker. It looks like we&apos;re escalating the per-user differentiation too high up.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&lt;b&gt;-------&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;UPDATE&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&#160;&lt;tt&gt;ResultRankerProvider&lt;/tt&gt; is replaced with a&#160;factory explicitly bound to user. &lt;br/&gt;
 The memory&#160;consumption part is tackled by &lt;a href=&quot;https://jira.magnolia-cms.com/browse/MLEARN-5&quot; title=&quot;Make neural network storage and ResultRanker user-aware&quot; class=&quot;issue-link&quot; data-issue-key=&quot;MLEARN-5&quot;&gt;&lt;del&gt;MLEARN-5&lt;/del&gt;&lt;/a&gt; and combines a cache approach in the factory with a pluggable&#160;storage strategy in order to mitigate possible performance issues.&lt;/p&gt;</description>
                <environment></environment>
        <key id="72745">MGNLPER-78</key>
            <summary>Provide factory for ResultRanker per user</summary>
                <type id="5" iconUrl="https://jira.magnolia-cms.com/secure/viewavatar?size=xsmall&amp;avatarId=10896&amp;avatarType=issuetype">Sub-task</type>
                            <parent id="72105">MGNLPER-72</parent>
                                    <priority id="6" iconUrl="https://jira.magnolia-cms.com/images/icons/priorities/neutral.gif">Neutral</priority>
                        <status id="6" iconUrl="https://jira.magnolia-cms.com/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="11">Done</resolution>
                                        <assignee username="fgrilli">Federico Grilli</assignee>
                                    <reporter username="fgrilli">Federico Grilli</reporter>
                        <labels>
                    </labels>
                <created>Wed, 16 Jan 2019 11:27:41 +0100</created>
                <updated>Tue, 29 Jan 2019 15:11:24 +0100</updated>
                            <resolved>Tue, 29 Jan 2019 12:36:28 +0100</resolved>
                                                    <fixVersion>1.1</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>0</watches>
                                                                                                                    <issuelinks>
                            <issuelinktype id="10020">
                    <name>dependency</name>
                                                                <inwardlinks description="is depended upon by">
                                        <issuelink>
            <issuekey id="72740">MLEARN-5</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10111" key="com.atlassian.jira.toolkit:reporterdomain">
                        <customfieldname>Company</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>magnolia-cms.com</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_12730" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_14151" key="com.atlassian.jira.toolkit:message">
                        <customfieldname>Docu info</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10061" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comm is not jira-dev</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>false</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10071" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last participant</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ajones</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_13136" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            5 years, 4 weeks, 4 days ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                            <customfield id="customfield_10020" key="com.atlassian.jira.toolkit:attachments">
                        <customfieldname>Number of attachments</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10150" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname>Number of comments</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10011" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>fgrilli</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                    <customfield id="customfield_10833" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|y00vz4:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10244" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10245" key="com.pyxis.greenhopper.jira:gh-sprint">
                        <customfieldname>Sprint</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue id="884">Foundation 2</customfieldvalue>
    <customfieldvalue id="892">Foundation 3</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14145" key="com.intenso.jira.issue-templates:issue-templates-customfield">
                        <customfieldname>Template</customfieldname>
                        <customfieldvalues>
                            


                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_15131" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Time in Discovery</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10032" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time in Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </customfields>
    </item>
</channel>
</rss>