All original content is created in Ukrainian. Not all content has been translated yet. Some posts may only be available in Ukrainian.Learn more

What is jemalloc and how does it relate to Ruby / Ruby on Rails

Post cover: What is jemalloc and how does it relate to Ruby / Ruby on Rails
This content has been automatically translated from Ukrainian.
What is jemalloc?. jemalloc (short for Jason Evans malloc) is a high-performance memory allocator that replaces the standard malloc implemented in the glibc standard library. It is used by large projects such as Redis, Firefox, Facebook, and even Android.
Its main advantages:
  • Less memory fragmentation
  • Better multithreaded performance
  • Transparent memory usage logging (via jemalloc profiling)

Why is jemalloc important for Ruby / Rails?

Ruby uses malloc for memory management, especially when working with objects. Under heavy load (for example, multithreaded Puma or Sidekiq), the standard allocator can cause memory fragmentation and slow cleanup.
By replacing malloc with jemalloc, you can achieve:
  • Less memory consumption in long-running processes
  • More stable RSS (Resident Set Size)
  • Potentially faster GC (Garbage Collector), as jemalloc manages object placement better

When does it make sense to enable jemalloc (if you haven't done so yet)?

If you notice that your Ruby / Rails processes are "bloated" in memory after several hours or days of operation β€” jemalloc can significantly help.
This is especially noticeable on:
  • Sidekiq / Resque
  • Puma / Unicorn under load
  • Services with long-running processes

This post doesn't have any additions from the author yet.

Where to find an older version of Google Chrome and download it? Using an old Mac as an example.
25 Apr 23:02

Where to find an older version of Google Chrome and download it? Using an old Mac as an example.

meme code
meme code@memecode
09 May 19:27

[FIXED] cannot load such file -- html/pipeline (LoadError) Π²ΠΈΠ½ΠΈΠΊΠ°Ρ” ΠΏΡ–Π΄ час rails generate thredded:install

meme code
meme code@memecode
Π—Π°Π΄Π°Ρ‡Π°: ΠŸΠ΅Ρ€Π΅Ρ‚Π²ΠΎΡ€Π΅Π½Π½Ρ Ρ€ΠΈΠΌΡΡŒΠΊΠΎΠ³ΠΎ числа Π½Π° дСсятковС (Ruby)
20 May 12:05

Π—Π°Π΄Π°Ρ‡Π°: ΠŸΠ΅Ρ€Π΅Ρ‚Π²ΠΎΡ€Π΅Π½Π½Ρ Ρ€ΠΈΠΌΡΡŒΠΊΠΎΠ³ΠΎ числа Π½Π° дСсятковС (Ruby)

meme code
meme code@memecode
Π—Π°Π΄Π°Ρ‡Π° Π½Π° ΠΏΠ΅Ρ€Π΅Π²Ρ–Ρ€ΠΊΡƒ ΠΏΡ€Π°Π²ΠΈΠ»ΡŒΠ½ΠΎΡΡ‚Ρ– розстановки Π΄ΡƒΠΆΠΎΠΊ (Ruby)
21 May 10:27

Π—Π°Π΄Π°Ρ‡Π° Π½Π° ΠΏΠ΅Ρ€Π΅Π²Ρ–Ρ€ΠΊΡƒ ΠΏΡ€Π°Π²ΠΈΠ»ΡŒΠ½ΠΎΡΡ‚Ρ– розстановки Π΄ΡƒΠΆΠΎΠΊ (Ruby)

meme code
meme code@memecode
Π―ΠΊ Π·Π½Π°ΠΉΡ‚ΠΈ підмасив Π· максимальною ΡΡƒΠΌΠΎΡŽ (Maximum Subarray Sum) Π² Ruby
22 May 11:01

Π―ΠΊ Π·Π½Π°ΠΉΡ‚ΠΈ підмасив Π· максимальною ΡΡƒΠΌΠΎΡŽ (Maximum Subarray Sum) Π² Ruby

meme code
meme code@memecode
Google Ads for Dummies: A Step-by-Step Guide for a Successful Start
28 May 10:21

Google Ads for Dummies: A Step-by-Step Guide for a Successful Start

meme code
meme code@memecode
05 Jun 01:52

[Fixed] uninitialized constant ActiveSupport::LoggerThreadSafeLevel::Logger (NameError)

meme code
meme code@memecode
The preview in the network tab after the Chrome update has become very small.
05 Jun 18:23

The preview in the network tab after the Chrome update has become very small.

meme code
meme code@memecode
What is the HEIC format and why simply renaming it to .jpg is a bad idea
15 Jun 18:17

What is the HEIC format and why simply renaming it to .jpg is a bad idea

meme code
meme code@memecode
Π§ΠΎΠΌΡƒ Π²ΠΈΠ±Ρ–Ρ€ CMS Π²Π°ΠΆΠ»ΠΈΠ²ΠΈΠΉ ΠΏΡ–Π΄ час Ρ€ΠΎΠ·Ρ€ΠΎΠ±ΠΊΠΈ сайту?
29 Jun 12:34

Π§ΠΎΠΌΡƒ Π²ΠΈΠ±Ρ–Ρ€ CMS Π²Π°ΠΆΠ»ΠΈΠ²ΠΈΠΉ ΠΏΡ–Π΄ час Ρ€ΠΎΠ·Ρ€ΠΎΠ±ΠΊΠΈ сайту?

meme code
meme code@memecode
Error 403 on the website: what it means and how to fix it
24 Jul 23:50

Error 403 on the website: what it means and how to fix it

meme code
meme code@memecode
What is vibe coding?
25 Jul 21:51

What is vibe coding?

meme code
meme code@memecode