Hacker News new | past | comments | ask | show | jobs | submit login

AFAIK ByteString suffers this problem: substrings will prevent their whole array from being GCed.

By default, data read from files, stdin, etc. is split into 64k chunks (e.g. see functions like 'hGetN' in http://hackage.haskell.org/package/bytestring-0.9.2.1/docs/s... ), so only the 64k chunks containing the parts we want will be kept.

There is a function 'copy' which will explicitly return a copy of only the character range that's used, so the original can be GCed ( https://hackage.haskell.org/package/bytestring-0.10.10.0/doc... )




Thanks for the clarification. BTW I agree with tome - your comment above would make a great blog post.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: