How does Ruby manage memory? | Saeloun Blog
12-Apr-2022 1287
Each programming language has its version of memory management so, let us look into how Ruby does this under the hood.For Dynamic Memory allocation, the Ruby program uses Heap memory and the basic unit of the heap is a slot. Here, each slot occupies a value which is known as RVALUE. This RVALUE comprises 40 bytes and a container for objects of all types (Array, String, Class). Out of these 40 bytes, the initial 8 bytes are reserved for a flag, followed by 8 bytes of Klass pointer. The remaining 24 bytes are reserved for object-specific fields.
How does Ruby manage memory? | Saeloun Blog #ruby #rubydeveloper #rubyonrails #manage #memory? #Saeloun #blog https://rubyonrails.ba/link/how-does-ruby-manage-memory-saeloun-blog