<!-- 
RSS generated by JIRA (4.4#649-r158309) at Tue May 21 20:04:16 CDT 2013

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 add field=key&field=summary to the URL of your request.
For example:
http://dev.clojure.org/jira/si/jira.issueviews:issue-xml/CLJ-708/CLJ-708.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Clojure JIRA</title>
    <link>http://dev.clojure.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>4.4</version>
        <build-number>649</build-number>
        <build-date>25-07-2011</build-date>
    </build-info>

<item>
            <title>[CLJ-708] Multi-methods hold onto the head of their arguments</title>
                <link>http://dev.clojure.org/jira/browse/CLJ-708</link>
                <project id="10010" key="CLJ">Clojure</project>
                        <description>&lt;p&gt;Multi-methods hold onto the head of their arguments when they are invoked.  This means that if you invoke a multi-method with a lazy seq that cannot be held in memory all at once, you blow heap.&lt;/p&gt;

&lt;p&gt;I&apos;m not sure how best to write a test case for this particular issue, since the easiest way to test it is to run the JVM with a small heap and purposely evoke an OutOfMemoryError, so the attached patch has only the code changes. (However, I have verified the fix using a small heap.)&lt;/p&gt;

&lt;p&gt;This will fix the issue for arities up to 6, for arities &amp;gt;=7 there is a bug in RestFn where it also holds the head of its arguments. If it is desirable to fix that bug as well, then I can submit a patch for it.&lt;/p&gt;</description>
                <environment></environment>
            <key id="14317">CLJ-708</key>
            <summary>Multi-methods hold onto the head of their arguments</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="3" iconUrl="http://dev.clojure.org/jira/images/icons/priority_major.gif">Major</priority>
                    <status id="6" iconUrl="http://dev.clojure.org/jira/images/icons/status_closed.gif">Closed</status>
                    <resolution id="1">Completed</resolution>
                                <assignee username="stu">Stuart Halloway</assignee>
                                <reporter username="pjstadig">Paul Stadig</reporter>
                        <labels>
                    </labels>
                <created>Sat, 8 Jan 2011 10:02:06 -0600</created>
                <updated>Fri, 11 Mar 2011 10:21:21 -0600</updated>
                    <resolved>Fri, 11 Mar 2011 10:21:20 -0600</resolved>
                            <version>Release 1.2</version>
                                <fixVersion>Release 1.3</fixVersion>
                                        <due></due>
                    <votes>0</votes>
                        <watches>2</watches>
                        <comments>
                    <comment id="26147" author="pjstadig" created="Fri, 21 Jan 2011 09:53:32 -0600"  >&lt;p&gt;Any thoughts on this?&lt;/p&gt;</comment>
                    <comment id="26154" author="stu" created="Fri, 21 Jan 2011 15:31:14 -0600"  >&lt;p&gt;I agree that no automated test is necessary for this. If you had attached your small-heap script I wouldn&apos;t have to write one from scratch to test it though. &lt;img class=&quot;emoticon&quot; src=&quot;http://dev.clojure.org/jira/images/icons/emoticons/smile.gif&quot; height=&quot;20&quot; width=&quot;20&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    <comment id="26155" author="stu" created="Fri, 21 Jan 2011 15:40:58 -0600"  >&lt;p&gt;Rich: two additional questions on this patch, other than just approval:&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;Do we want another ticket to fix a similar issue in RestFn?&lt;/li&gt;
	&lt;li&gt;Paul also inquired on the dev list about a 1.2.1 release for this fix. I dread the idea of going to point releases. Any suggestions on workarounds for this for people on the 1.2.x line?&lt;/li&gt;
&lt;/ol&gt;
</comment>
                    <comment id="26156" author="pjstadig" created="Fri, 21 Jan 2011 16:17:51 -0600"  >&lt;p&gt;RE: a 1.2.1 release&lt;/p&gt;

&lt;p&gt;This and the Keyword.intern fix both seem to be fixes for bugs that don&apos;t affect functionality, that would be worthy of a 1.2.1 release...I don&apos;t know if there are others that people would like to see in there.&lt;/p&gt;

&lt;p&gt;They both also seem rather &quot;trivial&quot; to merge into 1.2.  I&apos;m willing to shepherd the release if no one else is interested in it.&lt;/p&gt;</comment>
                    <comment id="26173" author="richhickey" created="Wed, 26 Jan 2011 06:54:14 -0600"  >&lt;p&gt;Patching both this and RestFn in a single go seems best.&lt;/p&gt;</comment>
                    <comment id="26174" author="richhickey" created="Wed, 26 Jan 2011 06:55:38 -0600"  >&lt;p&gt;We should have a discussion about what might constitute a 1.2.1 on the dev list.&lt;/p&gt;</comment>
                    <comment id="26211" author="pjstadig" created="Fri, 4 Feb 2011 08:21:08 -0600"  >&lt;p&gt;Here is an updated patch for both multi-methods and RestFn.&lt;/p&gt;

&lt;p&gt;I have also pushed a project to &lt;a href=&quot;http://github.com/pjstadig/blow-heap&quot;&gt;http://github.com/pjstadig/blow-heap&lt;/a&gt; that has some (gratuitous but automatically generated) tests for every arity combination.&lt;/p&gt;

&lt;p&gt;There is a bin directory in that project that contains a blow-heap.sh file that can be run.  It will call out to leiningen to run the tests, and the project.clj file is configured to start Java with a sufficiently small heap.&lt;/p&gt;

&lt;p&gt;You can change the dependencies in the project.clj file to clojure 1.2.0, run the script, and see it fail.  Then apply the patch to clojure, `mvn clean install`, go back to the blow-heap project and change the project.clj to use clojure 1.3.0 SNAPSHOT, `lein deps`, and rerun the tests to verify. (Whew!)&lt;/p&gt;

&lt;p&gt;I believe this patch should also apply cleanly to the 1.2.0 branch, since the multi-method and rest-fn classes haven&apos;t changed since then, but if that&apos;s not the case I can send another rebased patch.&lt;/p&gt;</comment>
                    <comment id="26228" author="stu" created="Tue, 22 Feb 2011 19:58:37 -0600"  >&lt;p&gt;The second commit has the windows-line-ending problem. Anybody know how to fix this in an automated way?&lt;/p&gt;</comment>
                    <comment id="26232" author="thnetos" created="Tue, 22 Feb 2011 23:45:18 -0600"  >&lt;p&gt;The same patch as Paul&apos;s, with unix line-endings&lt;/p&gt;</comment>
                    <comment id="26233" author="thnetos" created="Tue, 22 Feb 2011 23:45:52 -0600"  >&lt;p&gt;Stuart: See attached patch run through the dos2unix tool&lt;/p&gt;</comment>
                    <comment id="26288" author="stu" created="Sun, 6 Mar 2011 13:18:45 -0600"  >&lt;p&gt;tests pass, approach looks fine. I didn&apos;t read every line, let mw know if there is some automated test or analysis you think I should do&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="10074" name="muli-method-holds-head.diff" size="23270" author="pjstadig" created="Sat, 8 Jan 2011 10:02:07 -0600" />
                    <attachment id="10106" name="multi-and-rest-fn-fix.patch" size="216764" author="pjstadig" created="Fri, 4 Feb 2011 08:21:08 -0600" />
                    <attachment id="10116" name="multi-and-rest-fn-fix-unix.patch" size="212892" author="thnetos" created="Tue, 22 Feb 2011 23:45:18 -0600" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                <customfield id="customfield_10002" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Approval</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10007">Ok</customfieldvalue>

                </customfieldvalues>
            </customfield>
                                                                                    <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                            <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                <customfieldname>Patch</customfieldname>
                <customfieldvalues>
                        <customfieldvalue key="10001">Code</customfieldvalue>

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