Affects Version/s: Release 1.2
Fix Version/s: Release 1.3
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.
|Field||Original Value||New Value|
|Assignee||Stuart Halloway [ stu ]|
|Fix Version/s||Release.Next [ 10038 ]|
|Status||Open [ 1 ]||Closed [ 6 ]|
|Resolution||Completed [ 1 ]|