log in    sign up

Ruby Memory

Ruby Memory

The CRuby interpreter manages its memory in a complex and interesting way. Knowing about it can help you optimise your Ruby programs and also just generally understand what's going on.

(Log in to track progress or opt into emailed reminders.)

Faster Apps, No Memory Thrash

Learn how Ruby encodes objects in memory and how to optimise for it.

(Log in to track progress)

How CRuby Manages Memory: Slots and How to Use Them

After watching the video, here's a deeper (text) explanation of tiny, small and large Ruby objects in memory.

(Log in to track progress)

How Ruby Encodes References: Tiny Objects

Ruby 'tiny' objects, such as integers and floating-point numbers are encoded directly into the 64-bit reference that would otherwise point to a value. What can those references contain? How are they encoded?

(Log in to track progress)

Ruby Memory: Fragmentation and Bloat

Nate Berkopec explains Ruby memory fragmentation and how it can waste your memory. He also tells you how to detect and avoid it.

(Log in to track progress)

Benchmarking Ruby's Heap: Malloc, TCMalloc and jemalloc

Ruby uses a normal system allocator for most of its memory. That means GCC's allocator, or you can configure another like TCMalloc or jemalloc. What are the performance implications? Should you do so? (Spoiler: yes)

(Log in to track progress)

Halve Your Memory Usage with these 12 Weird Tricks

Here, Nate Berkopec gives a lot of interesting tricks to reduce your memory usage in Ruby. Each shows you something about how Ruby's memory system operates.

(Log in to track progress)

Ruby Memory Environment Variables: They're Simpler Than They Look

Ruby allows you to configure a lot of its memory handling with environment variables. Which variables? What do they do?

(Log in to track progress)

Looking for similar topics?

Comments

comments powered by Disqus