{"id":801,"date":"2026-01-22T00:00:00","date_gmt":"2026-01-22T08:00:00","guid":{"rendered":"https:\/\/en.pingcap.com\/blog\/linux-kernel-vs-memory-fragmentation-1\/"},"modified":"2026-01-27T11:41:24","modified_gmt":"2026-01-27T19:41:24","slug":"linux-kernel-vs-memory-fragmentation-1","status":"publish","type":"post","link":"https:\/\/www.pingcap.com\/ko\/blog\/linux-kernel-vs-memory-fragmentation-1\/","title":{"rendered":"Memory Fragmentation in Linux: What It Is, Why It Hurts, and How to Fix It"},"content":{"rendered":"\n<p>Managing memory in a high-performance database environment isn&#8217;t just about having enough RAM; it\u2019s about how that RAM is organized. For SREs and DBAs, understanding the nuances of the Linux kernel&#8217;s memory management can be the difference between a smooth-running system and unpredictable tail latency.<\/p>\n\n\n\n<p>In this post, we\u2019ll break down the core mechanics of memory fragmentation in Linux. We\u2019ll explore the inner workings of the buddy allocator and its primary defense mechanisms, such as page migration types, while clarifying the critical performance trade-offs between Transparent Huge Pages (THP) and hugetlb. Finally, we\u2019ll walk through concrete diagnostic workflows using <code>\/proc\/buddyinfo<\/code> and ftrace to help you quantify how memory compaction impacts tail latency in production environments like <a href=\"https:\/\/www.pingcap.com\/tidb\/\">TiDB<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Memory_Fragmentation_Explained_in_60_Seconds\"><\/span>Memory Fragmentation, Explained in 60 Seconds<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In the context of the Linux kernel, memory fragmentation refers to how physical RAM is allocated and used. It is specifically a concern for RAM and kernel memory, rather than disk defragmentation. The core constraint is contiguous memory allocation: the kernel often requires blocks of memory to be physically adjacent to one another to function efficiently.<\/p>\n\n\n\n<p>When these contiguous blocks are broken up, even if you have gigabytes of &#8220;free&#8221; memory, the kernel may struggle to find a single block large enough for its needs, leading to performance degradation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Internal_vs_External_Memory_Fragmentation_Linux_Reality_Check\"><\/span>Internal vs. External Memory Fragmentation (Linux Reality Check)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>To diagnose performance issues, you must first distinguish between the two types of fragmentation:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Internal Fragmentation<\/strong>: This occurs when the kernel allocates more memory than is actually requested. The &#8220;wasted&#8221; space exists inside the allocated block but cannot be used for other purposes.<\/li>\n\n\n\n<li><strong>External Memory Fragmentation<\/strong>: This is the primary concern for system performance. It happens when free memory is available in the system, but it is scattered in small, non-contiguous &#8220;holes&#8221;. Consequently, a request for a large contiguous block will fail even if the total free memory is sufficient.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_Virtual_Memory_Doesnt_Fully_Save_You_Kernel_DMA\"><\/span>Why Virtual Memory Doesn&#8217;t Fully Save You (Kernel + DMA)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You might wonder why fragmentation matters in an era of virtual memory, which maps non-contiguous physical pages into a contiguous virtual address space. While virtual contiguity helps applications, the kernel and hardware have stricter requirements:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Kernel Linear Mapping<\/strong>: Certain kernel subsystems rely on linear mapping for performance, requiring physical contiguity.<\/li>\n\n\n\n<li><strong>Device I\/O and DMA<\/strong>: Direct Memory Access (DMA) allows hardware devices to move data without involving the CPU. While some modern devices support &#8220;scatter-gather DMA,&#8221; many older or specialized devices still require large, physically contiguous buffers.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"The_Buddy_Allocator_How_Linux_Page_Orders_Create_Fragmentation\"><\/span>The Buddy Allocator: How Linux Page Orders Create Fragmentation<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Linux manages physical memory using the buddy allocator. It organizes memory into &#8220;orders,&#8221; where Order 0 is a single page (usually 4KB), Order 1 is two pages (8KB), and so on, doubling each time.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"559\" src=\"https:\/\/static.pingcap.com\/files\/2021\/02\/26133556\/image-3.png\" alt=\"A Linux buddy allocator for memory fragmentation showing orders splitting and merging.\" class=\"wp-image-31455\" srcset=\"https:\/\/static.pingcap.com\/files\/2021\/02\/26133556\/image-3.png 1024w, https:\/\/static.pingcap.com\/files\/2021\/02\/26133556\/image-3-300x164.png 300w, https:\/\/static.pingcap.com\/files\/2021\/02\/26133556\/image-3-768x419.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"has-text-align-center\"><em>Figure 1. A Linux buddy allocator showing orders splitting and merging.<\/em><\/p>\n\n\n\n<p>When a high-order allocation (a large contiguous block) is requested, the allocator splits larger blocks into &#8220;buddies&#8221;. Conversely, when blocks are freed, they merge back together. Fragmentation occurs when these high-order blocks become scarce because small, unmovable allocations are scattered across the memory map, preventing buddies from merging.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Where the Slab Allocator Fits (SLUB\/SLAB)<\/h3>\n\n\n\n<p>While the buddy allocator handles large blocks of pages, the slab allocator (typically SLUB in modern kernels) manages smaller objects like task descriptors or inodes. The slab allocator ultimately consumes pages from the buddy allocator. When slab growth is high, it can place significant pressure on contiguous blocks, contributing to external fragmentation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Page_Migration_Migration_Types_Linuxs_First_Line_of_Defense\"><\/span>Page Migration &amp; Migration Types: Linux&#8217;s First Line of Defense<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>To combat fragmentation, the kernel categorizes memory pages into migration types to prevent &#8220;unmovable&#8221; pages from polluting blocks that could otherwise be compacted:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>MIGRATE_UNMOVABLE<\/strong>: Pages that cannot be moved, such as those allocated by the kernel.<\/li>\n\n\n\n<li><strong>MIGRATE_MOVABLE<\/strong>: Pages that can be relocated, typically used for user-space applications.<\/li>\n\n\n\n<li><strong>MIGRATE_RECLAIMABLE<\/strong>: Pages that can be discarded and freed, like file caches.<\/li>\n<\/ul>\n\n\n\n<p>When the kernel cannot fulfill a request from the preferred migration type, it performs a &#8220;fallback&#8221; allocation. Frequent fallback behavior is a clear signal of high external memory fragmentation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Huge_Pages_hugetlb_and_Transparent_Huge_Pages_THP_When_Fragmentation_Gets_Expensive\"><\/span>Huge Pages, hugetlb, and Transparent Huge Pages (THP): When Fragmentation Gets Expensive<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p><a href=\"https:\/\/www.pingcap.com\/blog\/why-distributed-sql-databases-elevate-modern-app-dev\/\">Distributed SQL databases<\/a> like TiDB benefit from huge pages, which reduce the overhead of page table lookups. However, because huge pages require large contiguous blocks (e.g., 2MB or 1GB), they make fragmentation much more visible.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td><strong>Feature<\/strong><\/td><td><strong>Transparent Huge Pages (THP)<\/strong><\/td><td><strong>hugetlb<\/strong><\/td><td><strong>Explicit Huge Pages<\/strong><\/td><\/tr><tr><td><strong>Allocation<\/strong><\/td><td>Automatic by kernel<\/td><td>Pre-allocated at boot\/runtime<\/td><td>Manual management<\/td><\/tr><tr><td><strong>Complexity<\/strong><\/td><td>Low (plug and play)<\/td><td>Medium<\/td><td>High<\/td><\/tr><tr><td><strong>Predictability<\/strong><\/td><td>Low (can cause latency)<\/td><td>High<\/td><td>High<\/td><\/tr><tr><td><strong>Use Case<\/strong><\/td><td>General workloads<\/td><td>Databases\/Latency-sensitive<\/td><td>Specialized high-perf<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><br>When to Disable THP for Databases (and What to Do Instead)<\/h3>\n\n\n\n<p>While Transparent Huge Pages (THP) aim to simplify memory management, it can cause significant latency spikes for databases. The kernel&#8217;s background &#8220;khugepaged&#8221; thread may struggle to find contiguous memory, leading to aggressive compaction and stalls.<\/p>\n\n\n\n<p>For production databases, the standard operational default is to disable THP and use explicit huge pages (hugetlb) instead. This ensures that the memory is reserved at startup, providing predictable performance. For more details, see our guide on <a href=\"https:\/\/www.pingcap.com\/blog\/transparent-huge-pages-why-we-disable-it-for-databases\/\">Transparent Huge Pages (THP) for databases<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Memory_Compaction_How_Linux_Rebuilds_Contiguous_Free_Blocks\"><\/span>Memory Compaction: How Linux Rebuilds Contiguous Free Blocks<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Memory compaction is the process by which the kernel relocates movable pages to create larger contiguous blocks of free space.<\/p>\n\n\n\n<p>While essential, compaction can be a double-edged sword. &#8220;Direct compaction&#8221; occurs when a process is forced to wait for the kernel to defragment memory during an allocation request, leading to massive latency spikes and performance cliffs.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_to_Detect_Memory_Fragmentation_the_Commands_that_Matter\"><\/span>How to Detect Memory Fragmentation (the Commands that Matter)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Diagnosing fragmentation requires looking beyond basic tools like free or top.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>\/proc\/buddyinfo<\/code><\/strong>: Shows the count of available blocks for each order across different memory zones. If the numbers are high for Order 0 but low for Order 10, your system is heavily fragmented.<\/li>\n\n\n\n<li><strong><code>\/proc\/pagetypeinfo<\/code><\/strong>: Provides insight into the distribution of migration types and how often fallbacks are occurring.<\/li>\n\n\n\n<li><strong>Fragmentation Index<\/strong>: Some kernels provide a fragmentation index via \/sys to quantify the severity of the issue.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Measure External Fragmentation Events with ftrace (Step-by-Step)<\/h3>\n\n\n\n<p>For a deep dive, you can use ftrace to capture fragmentation events in real-time:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Enable the event<\/strong>:<code> echo 1 &gt; \/sys\/kernel\/debug\/tracing\/events\/kmem\/mm_page_alloc_extfrag\/enable<\/code><\/li>\n\n\n\n<li><strong>Collect data<\/strong>: <code>cat \/sys\/kernel\/debug\/tracing\/trace_pipe &gt; frag_log.txt<\/code><\/li>\n\n\n\n<li><strong>Interpret results<\/strong>: Look for &#8220;fallback&#8221; events. An example event line might look like this:<br><br><code>mm_page_alloc_extfrag: page=0x12345 pfn=74565 alloc_order=9 fallback_order=0<\/code><br><\/li>\n\n\n\n<li><strong>Parse with awk<\/strong>: <code>awk '\/fallback_order\/ {print $NF}' frag_log.txt | sort | uniq -c<\/code><\/li>\n\n\n\n<li><strong>Disable tracing<\/strong>: <code>echo 0 &gt; \/sys\/kernel\/debug\/tracing\/events\/kmem\/mm_page_alloc_extfrag\/enable<\/code><\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Mitigation_Checklist_for_Production_Database_Servers\"><\/span>Mitigation Checklist for Production Database Servers<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>To maintain a healthy Linux environment for your databases, follow this checklist:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>[ ] <strong>Reduce high-order dependencies<\/strong>: Avoid kernel-level configurations that require massive contiguous blocks at runtime.<\/li>\n\n\n\n<li>[ ] <strong>Set a Huge Page Strategy<\/strong>: Choose between THP and hugetlb intentionally; for databases, explicit huge pages are usually preferred.<\/li>\n\n\n\n<li>[ ] <strong>Baseline Performance<\/strong>: Establish a baseline for compaction and fallback events so you can alert on sudden spikes.<\/li>\n\n\n\n<li>[ ] <strong>Trace System Behavior<\/strong>: Use tools like ftrace to <a href=\"https:\/\/www.pingcap.com\/blog\/how-to-trace-linux-system-calls-in-production-with-minimal-impact-on-performance\/\">trace Linux system behavior in production<\/a> with minimal impact.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_this_Matters_for_TiDB_Workloads_Predictable_Tail_Latency\"><\/span>Why this Matters for TiDB Workloads (Predictable Tail Latency)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>In distributed databases like TiDB, consistent performance is key to meeting Service Level Objectives (SLOs). When memory fragmentation triggers background compaction or direct reclaim, it directly translates into database tail latency. By understanding and mitigating these kernel-level bottlenecks, you ensure that your <a href=\"https:\/\/www.pingcap.com\/tidb\/cloud\/\">deployment options for predictable performance<\/a> remain stable even under heavy load.<\/p>\n\n\n\n<p>Ready to see how TiDB handles high-performance workloads?<strong> <\/strong><a href=\"https:\/\/www.pingcap.com\/solutions\/modernize-mysql-workloads\/\">Modernize MySQL workloads without manual sharding<\/a> or explore<a href=\"https:\/\/www.pingcap.com\/blog\/linux-kernel-vs-memory-fragmentation-2\/\"> Linux kernel memory fragmentation, continued (Part II)<\/a> for even deeper technical insights.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"FAQ_Memory_Fragmentation_in_Linux_Quick_Answers\"><\/span>FAQ: Memory Fragmentation in Linux (Quick Answers)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Can RAM be Fragmented?<\/h3>\n\n\n\n<p>Yes. While RAM doesn&#8217;t have moving parts like a hard drive, &#8220;fragmentation&#8221; refers to the lack of contiguous physical memory blocks, which the Linux kernel requires for certain operations.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Is Fragmentation Still an Issue on Modern Kernels?<\/h3>\n\n\n\n<p>Absolutely. While modern kernels have improved compaction algorithms and migration types, the increasing use of huge pages and massive RAM capacities makes the impact of fragmentation even more significant.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Does Compaction Always Help?<\/h3>\n\n\n\n<p>Not necessarily. While it frees up contiguous blocks, the CPU overhead of moving pages can cause performance degradation that outweighs the benefits, especially during &#8220;direct compaction&#8221;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Managing memory in a high-performance database environment isn&#8217;t just about having enough RAM; it\u2019s about how that RAM is organized. For SREs and DBAs, understanding the nuances of the Linux kernel&#8217;s memory management can be the difference between a smooth-running system and unpredictable tail latency. In this post, we\u2019ll break down the core mechanics of [&hellip;]<\/p>\n","protected":false},"author":218,"featured_media":31487,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ub_ctt_via":"","footnotes":""},"categories":[241],"tags":[148,147,70,447,111],"class_list":["post-801","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-what-is","tag-distributed-database","tag-distributed-sql","tag-linux","tag-memory-fragmentation","tag-tidb"],"acf":[],"featured_image_src":"https:\/\/static.pingcap.com\/files\/2021\/02\/27112250\/tidb_feature_1800x600-1.png","author_info":{"display_name":"Brian Foster","author_link":"https:\/\/www.pingcap.com\/ko\/blog\/author\/brian-james-foster\/"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Memory Fragmentation in Linux: Causes, Fixes &amp; Tools<\/title>\n<meta name=\"description\" content=\"Understand Linux memory fragmentation (internal vs external), huge pages\/THP, buddy allocator, compaction, and how to diagnose &amp; reduce it.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pingcap.com\/ko\/blog\/linux-kernel-vs-memory-fragmentation-1\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Memory Fragmentation in Linux: Causes, Fixes &amp; Tools\" \/>\n<meta property=\"og:description\" content=\"Understand Linux memory fragmentation (internal vs external), huge pages\/THP, buddy allocator, compaction, and how to diagnose &amp; reduce it.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pingcap.com\/ko\/blog\/linux-kernel-vs-memory-fragmentation-1\/\" \/>\n<meta property=\"og:site_name\" content=\"TiDB\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/facebook.com\/pingcap2015\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-22T08:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-01-27T19:41:24+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/static.pingcap.com\/files\/2021\/02\/27112310\/tidb_1200x627-2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"2400\" \/>\n\t<meta property=\"og:image:height\" content=\"1254\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Brian Foster\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/static.pingcap.com\/files\/2021\/02\/27112323\/tidb_twitter_1600x900-3.png\" \/>\n<meta name=\"twitter:creator\" content=\"@PingCAP\" \/>\n<meta name=\"twitter:site\" content=\"@PingCAP\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Brian Foster\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.pingcap.com\/blog\/linux-kernel-vs-memory-fragmentation-1\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/linux-kernel-vs-memory-fragmentation-1\/\"},\"author\":{\"name\":\"Brian Foster\",\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/person\/e2c94b706bf3eaeebbd9a511005c41f2\"},\"headline\":\"Memory Fragmentation in Linux: What It Is, Why It Hurts, and How to Fix It\",\"datePublished\":\"2026-01-22T08:00:00+00:00\",\"dateModified\":\"2026-01-27T19:41:24+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/linux-kernel-vs-memory-fragmentation-1\/\"},\"wordCount\":1335,\"publisher\":{\"@id\":\"https:\/\/www.pingcap.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/linux-kernel-vs-memory-fragmentation-1\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/static.pingcap.com\/files\/2021\/02\/27112250\/tidb_feature_1800x600-1.png\",\"keywords\":[\"Distributed Database\",\"Distributed SQL\",\"Linux\",\"Memory Fragmentation\",\"TiDB\"],\"articleSection\":[\"What Is\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.pingcap.com\/blog\/linux-kernel-vs-memory-fragmentation-1\/\",\"url\":\"https:\/\/www.pingcap.com\/blog\/linux-kernel-vs-memory-fragmentation-1\/\",\"name\":\"Memory Fragmentation in Linux: Causes, Fixes & Tools\",\"isPartOf\":{\"@id\":\"https:\/\/www.pingcap.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/linux-kernel-vs-memory-fragmentation-1\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/linux-kernel-vs-memory-fragmentation-1\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/static.pingcap.com\/files\/2021\/02\/27112250\/tidb_feature_1800x600-1.png\",\"datePublished\":\"2026-01-22T08:00:00+00:00\",\"dateModified\":\"2026-01-27T19:41:24+00:00\",\"description\":\"Understand Linux memory fragmentation (internal vs external), huge pages\/THP, buddy allocator, compaction, and how to diagnose & reduce it.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.pingcap.com\/blog\/linux-kernel-vs-memory-fragmentation-1\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.pingcap.com\/blog\/linux-kernel-vs-memory-fragmentation-1\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.pingcap.com\/blog\/linux-kernel-vs-memory-fragmentation-1\/#primaryimage\",\"url\":\"https:\/\/static.pingcap.com\/files\/2021\/02\/27112250\/tidb_feature_1800x600-1.png\",\"contentUrl\":\"https:\/\/static.pingcap.com\/files\/2021\/02\/27112250\/tidb_feature_1800x600-1.png\",\"width\":3600,\"height\":1200},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.pingcap.com\/blog\/linux-kernel-vs-memory-fragmentation-1\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.pingcap.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Memory Fragmentation in Linux: What It Is, Why It Hurts, and How to Fix It\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.pingcap.com\/#website\",\"url\":\"https:\/\/www.pingcap.com\/\",\"name\":\"TiDB\",\"description\":\"TiDB | SQL at Scale\",\"publisher\":{\"@id\":\"https:\/\/www.pingcap.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.pingcap.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.pingcap.com\/#organization\",\"name\":\"PingCAP\",\"url\":\"https:\/\/www.pingcap.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png\",\"contentUrl\":\"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png\",\"width\":811,\"height\":232,\"caption\":\"PingCAP\"},\"image\":{\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/facebook.com\/pingcap2015\",\"https:\/\/x.com\/PingCAP\",\"https:\/\/linkedin.com\/company\/pingcap\",\"https:\/\/youtube.com\/channel\/UCuq4puT32DzHKT5rU1IZpIA\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/person\/e2c94b706bf3eaeebbd9a511005c41f2\",\"name\":\"Brian Foster\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.pingcap.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/static.pingcap.com\/files\/2023\/07\/06161300\/brian-foster-150x150.jpeg\",\"contentUrl\":\"https:\/\/static.pingcap.com\/files\/2023\/07\/06161300\/brian-foster-150x150.jpeg\",\"caption\":\"Brian Foster\"},\"description\":\"Global Content Director\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/brian-foster-33453a6\/\"],\"url\":\"https:\/\/www.pingcap.com\/ko\/blog\/author\/brian-james-foster\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Memory Fragmentation in Linux: Causes, Fixes & Tools","description":"Understand Linux memory fragmentation (internal vs external), huge pages\/THP, buddy allocator, compaction, and how to diagnose & reduce it.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pingcap.com\/ko\/blog\/linux-kernel-vs-memory-fragmentation-1\/","og_locale":"ko_KR","og_type":"article","og_title":"Memory Fragmentation in Linux: Causes, Fixes & Tools","og_description":"Understand Linux memory fragmentation (internal vs external), huge pages\/THP, buddy allocator, compaction, and how to diagnose & reduce it.","og_url":"https:\/\/www.pingcap.com\/ko\/blog\/linux-kernel-vs-memory-fragmentation-1\/","og_site_name":"TiDB","article_publisher":"https:\/\/facebook.com\/pingcap2015","article_published_time":"2026-01-22T08:00:00+00:00","article_modified_time":"2026-01-27T19:41:24+00:00","og_image":[{"width":2400,"height":1254,"url":"https:\/\/static.pingcap.com\/files\/2021\/02\/27112310\/tidb_1200x627-2.png","type":"image\/png"}],"author":"Brian Foster","twitter_card":"summary_large_image","twitter_image":"https:\/\/static.pingcap.com\/files\/2021\/02\/27112323\/tidb_twitter_1600x900-3.png","twitter_creator":"@PingCAP","twitter_site":"@PingCAP","twitter_misc":{"Written by":"Brian Foster","Est. reading time":"7\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pingcap.com\/blog\/linux-kernel-vs-memory-fragmentation-1\/#article","isPartOf":{"@id":"https:\/\/www.pingcap.com\/blog\/linux-kernel-vs-memory-fragmentation-1\/"},"author":{"name":"Brian Foster","@id":"https:\/\/www.pingcap.com\/#\/schema\/person\/e2c94b706bf3eaeebbd9a511005c41f2"},"headline":"Memory Fragmentation in Linux: What It Is, Why It Hurts, and How to Fix It","datePublished":"2026-01-22T08:00:00+00:00","dateModified":"2026-01-27T19:41:24+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pingcap.com\/blog\/linux-kernel-vs-memory-fragmentation-1\/"},"wordCount":1335,"publisher":{"@id":"https:\/\/www.pingcap.com\/#organization"},"image":{"@id":"https:\/\/www.pingcap.com\/blog\/linux-kernel-vs-memory-fragmentation-1\/#primaryimage"},"thumbnailUrl":"https:\/\/static.pingcap.com\/files\/2021\/02\/27112250\/tidb_feature_1800x600-1.png","keywords":["Distributed Database","Distributed SQL","Linux","Memory Fragmentation","TiDB"],"articleSection":["What Is"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/www.pingcap.com\/blog\/linux-kernel-vs-memory-fragmentation-1\/","url":"https:\/\/www.pingcap.com\/blog\/linux-kernel-vs-memory-fragmentation-1\/","name":"Memory Fragmentation in Linux: Causes, Fixes & Tools","isPartOf":{"@id":"https:\/\/www.pingcap.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pingcap.com\/blog\/linux-kernel-vs-memory-fragmentation-1\/#primaryimage"},"image":{"@id":"https:\/\/www.pingcap.com\/blog\/linux-kernel-vs-memory-fragmentation-1\/#primaryimage"},"thumbnailUrl":"https:\/\/static.pingcap.com\/files\/2021\/02\/27112250\/tidb_feature_1800x600-1.png","datePublished":"2026-01-22T08:00:00+00:00","dateModified":"2026-01-27T19:41:24+00:00","description":"Understand Linux memory fragmentation (internal vs external), huge pages\/THP, buddy allocator, compaction, and how to diagnose & reduce it.","breadcrumb":{"@id":"https:\/\/www.pingcap.com\/blog\/linux-kernel-vs-memory-fragmentation-1\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pingcap.com\/blog\/linux-kernel-vs-memory-fragmentation-1\/"]}]},{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.pingcap.com\/blog\/linux-kernel-vs-memory-fragmentation-1\/#primaryimage","url":"https:\/\/static.pingcap.com\/files\/2021\/02\/27112250\/tidb_feature_1800x600-1.png","contentUrl":"https:\/\/static.pingcap.com\/files\/2021\/02\/27112250\/tidb_feature_1800x600-1.png","width":3600,"height":1200},{"@type":"BreadcrumbList","@id":"https:\/\/www.pingcap.com\/blog\/linux-kernel-vs-memory-fragmentation-1\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pingcap.com\/"},{"@type":"ListItem","position":2,"name":"Memory Fragmentation in Linux: What It Is, Why It Hurts, and How to Fix It"}]},{"@type":"WebSite","@id":"https:\/\/www.pingcap.com\/#website","url":"https:\/\/www.pingcap.com\/","name":"\ud2f0DB","description":"TiDB | SQL at Scale","publisher":{"@id":"https:\/\/www.pingcap.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pingcap.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/www.pingcap.com\/#organization","name":"PingCAP","url":"https:\/\/www.pingcap.com\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/","url":"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png","contentUrl":"https:\/\/static.pingcap.com\/files\/2021\/11\/pingcap-logo.png","width":811,"height":232,"caption":"PingCAP"},"image":{"@id":"https:\/\/www.pingcap.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/facebook.com\/pingcap2015","https:\/\/x.com\/PingCAP","https:\/\/linkedin.com\/company\/pingcap","https:\/\/youtube.com\/channel\/UCuq4puT32DzHKT5rU1IZpIA"]},{"@type":"Person","@id":"https:\/\/www.pingcap.com\/#\/schema\/person\/e2c94b706bf3eaeebbd9a511005c41f2","name":"Brian Foster","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.pingcap.com\/#\/schema\/person\/image\/","url":"https:\/\/static.pingcap.com\/files\/2023\/07\/06161300\/brian-foster-150x150.jpeg","contentUrl":"https:\/\/static.pingcap.com\/files\/2023\/07\/06161300\/brian-foster-150x150.jpeg","caption":"Brian Foster"},"description":"Global Content Director","sameAs":["https:\/\/www.linkedin.com\/in\/brian-foster-33453a6\/"],"url":"https:\/\/www.pingcap.com\/ko\/blog\/author\/brian-james-foster\/"}]}},"grav_blocks":false,"card_markup":"<a class=\"card-resource bg-white\" href=\"https:\/\/www.pingcap.com\/ko\/blog\/linux-kernel-vs-memory-fragmentation-1\/\"><div class=\"card-resource__image-container\"><img class=\"card-resource__image\" alt=\"tidb_feature_1800x600 (1)\" src=\"https:\/\/static.pingcap.com\/files\/2021\/02\/27112250\/tidb_feature_1800x600-1.png\" loading=\"lazy\" width=3600 height=1200 \/><\/div><div class=\"card-resource__content-container\"><div class=\"card-resource__content-head\"><div class=\"card-resource__category\">What Is<\/div><\/div><h5 class=\"card-resource__title\">Memory Fragmentation in Linux: What It Is, Why It Hurts, and How to Fix It<\/h5><\/div><\/a>","_links":{"self":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts\/801","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/users\/218"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/comments?post=801"}],"version-history":[{"count":10,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts\/801\/revisions"}],"predecessor-version":[{"id":31494,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/posts\/801\/revisions\/31494"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/media\/31487"}],"wp:attachment":[{"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/media?parent=801"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/categories?post=801"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pingcap.com\/ko\/wp-json\/wp\/v2\/tags?post=801"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}