Meta Details Foundational Infrastructure

Meta's engineering team published deep dives on two core infrastructure components that power its platforms. The company reaffirmed its commitment to the high-performance memory allocator 'jemalloc' and detailed its large-scale use of FFmpeg for media processing, both critical for handling ML and media workloads.

The memory allocator 'jemalloc' was created by Jason Evans and first used in FreeBSD in 2005 to combat memory fragmentation and improve performance on multi-core processors. Its design focuses on scalable concurrency, a key reason it was adopted by performance-critical applications like Firefox and Meta's backend services. At the core of jemalloc's scalability is the use of multiple memory "arenas," which reduces lock contention in multi-threaded applications. Threads are assigned to different arenas, minimizing the chances they will compete for the same memory resources, a crucial optimization for the concurrent workloads seen in recommendation systems and large-scale data processing. This approach puts it in direct competition with other allocators like Google's tcmalloc. Meta's renewed commitment to jemalloc follows a period where internal modifications led to technical debt that slowed progress. The engineering team is now collaborating with the open-source community and project founder Jason Evans to modernize the codebase and improve features like the huge-page allocator (HPA) to better leverage modern hardware for improved CPU efficiency. On the media front, the scale of FFmpeg usage at Meta is immense, with its command-line tools for transcoding and media analysis being executed tens of billions of times per day. This processing is fundamental to all of Meta's video products, including Reels, where trillions of items are processed daily. For years, Meta maintained its own internal fork of FFmpeg to add critical features like threaded multi-lane transcoding that the upstream open-source version lacked. The company has since worked with FFmpeg developers to integrate these features into the main project, allowing Meta to deprecate its custom version and rely exclusively on the public builds. To handle its massive video workload efficiently, Meta developed a custom ASIC for video transcoding called the Meta Scalable Video Processor (MSVP). The company's engineers added support for this specialized hardware directly into the open-source FFmpeg codebase, enabling their internal teams to use the same standard tooling across both custom and commodity hardware. Understanding these foundational layers is critical for applied ML roles. The engineering trade-offs in memory management directly impact model inference latency and throughput, while mastering media processing pipelines is essential for building computer vision and recommendation systems that operate on web-scale datasets.

Get your own daily briefing

Scout delivers personalized news, insights, and conversations tailored to your role and industry.

Download on the App Store

Shared from Scout - Be the smartest in the room.