Just discovered a roc language server memory leak. Still trying to minimize the reproduction, but it consistently occurs in the following case:
expect
parser = zip_6(digit, digit, digit, digit, digit, digit)
# should be tuple w/ 6 values, not 5.
parser("123456") |> finalize_lazy == Ok((1, 2, 3, 4, 5))
# adding a 6th value to the tuple result prevents leak
# ie: == Ok((1, 2, 3, 4, 5, 6))
Screenshot 2025-02-12 at 18.48.03.png
Is it safe to assume that the language server is also on the verge of a rewrite, and therefore reporting bugs in the current language server is effectively kicking a dead horse?
I'd say that yes
But the horse is dead, so it won't mind
LOL! Well while we're kicking that dead horse, I may found another (possibly related, probably not) memory leak in the memory server. It also affects roc check
.
alphanumeric_identifier = one_of([
non_digit_as_arr,
non_digit_and_identifier_characters,
identifier_characters_and_non_digit,
# identifier_characters_and_non_digit_and_identifier_characters,
])
non_digit_as_arr = non_digit |> map(|c| Ok([c]))
non_digit_and_identifier_characters = both(non_digit, identifier_characters) |> map(|(c, cs)| Ok(List.join([[c], cs])))
identifier_characters_and_non_digit = both(identifier_characters, non_digit) |> map(|(cs, c)| Ok(List.join([cs, [c]])))
identifier_characters_and_non_digit_and_identifier_characters = zip_3(identifier_characters, non_digit, identifier_characters) |> map(|(cs1, c, cs2)| Ok(List.join([cs1, [c], cs2])))
The language server identifies all four of those as having the identical type signature. However if I uncomment the 4th element in one_of
, the language server balloons to 10's of gigs, and roc check
does the same.
Totally just kickin' the dead horse here, but this this is driving me nuts, so I came to rant! :triumph::sweat_smile:
Worth noting this doesn't just affect the memory server, but again, since we're in the middle of a rewrite, this isn't a long term concern.
Ian McLerran has marked this topic as resolved.
Last updated: Jul 06 2025 at 12:14 UTC