Ruby 2.7 and 3.0 Forking Memory Consumption

Viewed 74

Can anyone say how good Ruby 2.7 and 3.0 forking is, with regard to memory consumption (and is one substantially better than the other)? If I understand correctly, copy-on-write is implemented by the OS so that memory use is minimal, but how well does it work with Ruby processes?

I'm trying to understand the memory cost of using forks as opposed to other solutions such as Ruby 3.0 ractors, JRuby threads, other languages, etc. There would be a high cost to switching to one of those other implementations, but I'm wondering how much memory might be saved.

I realize that "it depends" but was looking for general information.

I also realize that there are other issues in favor of forking, such as one is guaranteed no bleeding of one task's data over to the other.

0 Answers
Related