8 ms·
I know that Ruby was broadly a horrible mess in, say, 2010. For example, the Ruby interpreter never returned dealocated memory to main, it just kept anything d
by joe_the_user 11y ago
I know that Ruby was broadly a horrible mess in, say, 2010.
For example, the Ruby interpreter never returned dealocated memory to main, it just kept anything deallocated by a program in it's own memory - copy a huge file between machines, wind-up with a
The head of operations of Twitter told me that at one point they were starting and killing ruby processes every minute because of Ruby's huge memory appetites and they not only had to throw huge amounts of hardware at the problem but also throw huge amounts of electricity to keep with the CPU churn.
- nilved 11y agoI'm quite sure that's still the case. MRI will never return memory to the OS. (I am open to being corrected, since it has been several major versions since I verified this.)
- nateberkopec 11y agoIt's true in practice but not in theory. Ruby can't defragment memory pages - if there is an active object in any heap page, it cannot be released back to the OS. Technically, Ruby does release empty pages back to the OS, but in practice, heap pages are rarely completely empty.
- empthought 11y ago> copy a huge file between machines This doesn't need very much memory.
- joe_the_user 11y agoSure but just do it with a huge cache. It's not about how to X efficiently but just that when you allocate a huge chunk of memory, the system will not see that memory until the interpreter terminates.