takeRight can result in OutOfMemoryExceptions being thrown
johnmcclean opened this issue · 2 comments
johnmcclean commented
e.g.
assertThat(empty.takeRight(Integer.MAX_VALUE),equalTo(empty));
The underlying cause is the use of takeRight on ReactiveSeq which allocates an ArrayDeque of the specified size to capture the last X values. Sizing the ArrayDeque to a sensible max and switching to a LinkedList above that max would solve this issue.
johnmcclean commented
Related to #1012
johnmcclean commented
Merged in #1016