Details
-
Type:
Defect
-
Status:
Closed
-
Priority:
Major
-
Resolution: Completed
-
Affects Version/s: Release 1.2
-
Fix Version/s: Release 1.3
-
Component/s: None
-
Labels:None
-
Patch:Code
-
Approval:Ok
Description
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.
I'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.)
This will fix the issue for arities up to 6, for arities >=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.
Attachments
Activity
Stuart Halloway
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Assignee | Stuart Halloway [ stu ] |
Stuart Halloway
made changes -
| Fix Version/s | Release.Next [ 10038 ] | |
| Approval | Screened |
Rich Hickey
made changes -
| Approval | Screened | Incomplete |
Paul Stadig
made changes -
| Attachment | multi-and-rest-fn-fix.patch [ 10106 ] |
Stuart Halloway
made changes -
| Waiting On | pjstadig |
Matthew Lee Hinman
made changes -
| Attachment | multi-and-rest-fn-fix-unix.patch [ 10116 ] |
Stuart Halloway
made changes -
| Approval | Incomplete | Test |
| Waiting On | pjstadig | stu |
Stuart Halloway
made changes -
| Approval | Test | Screened |
| Waiting On | stu |
Rich Hickey
made changes -
| Approval | Screened | Ok |
Stuart Halloway
made changes -
| Status | Open [ 1 ] | Closed [ 6 ] |
| Resolution | Completed [ 1 ] |
Any thoughts on this?