{"id":2482,"date":"2026-10-05T12:30:00","date_gmt":"2026-10-05T09:30:00","guid":{"rendered":"https:\/\/narhost.com\/destek\/?p=2482"},"modified":"2026-10-05T12:30:00","modified_gmt":"2026-10-05T09:30:00","slug":"linux-out-of-memory-hatasi","status":"publish","type":"post","link":"https:\/\/narhost.com\/destek\/linux-out-of-memory-hatasi\/","title":{"rendered":"Linux Out of Memory (OOM Killer) Hatas\u0131 Nas\u0131l \u00c7\u00f6z\u00fcl\u00fcr"},"content":{"rendered":"<p class=\"kb-dogrulama\">Son g\u00f6zden ge\u00e7irme: Eyl\u00fcl 2026 \u00b7 Ubuntu 24.04 ve Linux \u00e7ekirde\u011fi resm\u00ee dok\u00fcman\u0131na g\u00f6re<\/p>\n<div id=\"hizli-cozum\" class=\"ai-box ai-box--cozum\">\n<p class=\"ai-box-title\">H\u0131zl\u0131 \u00e7\u00f6z\u00fcm<\/p>\n<p><code>Out of memory: Killed process 1234 (mysqld)<\/code> \u2014 <strong>Linux out of memory<\/strong> durumunda RAM ve swap t\u00fckenince \u00e7ekirde\u011fin OOM killer&#8217;\u0131 en \u00e7ok bellek tutan s\u00fcreci sonland\u0131r\u0131r; site aniden kapan\u0131r, veritaban\u0131 &#8220;kendili\u011finden&#8221; durur. \u00c7\u00f6z\u00fcm \u00f6nce hangi s\u00fcrecin \u00f6ld\u00fcr\u00fcld\u00fc\u011f\u00fcn\u00fc bulmak, sonra o servisin bellek ayar\u0131n\u0131 k\u00fc\u00e7\u00fcltmektir.<\/p>\n<ol>\n<li><code>sudo dmesg -T | grep -iE \"out of memory|killed process\"<\/code> ile olay\u0131 ve s\u00fcreci bulun.<\/li>\n<li><code>free -h<\/code> ve <code>ps aux --sort=-%mem | head<\/code> ile belle\u011fi kimin kulland\u0131\u011f\u0131n\u0131 g\u00f6r\u00fcn.<\/li>\n<li>Swap yoksa ekleyin; PHP-FPM ve MySQL bellek ayarlar\u0131n\u0131 RAM&#8217;e g\u00f6re d\u00fc\u015f\u00fcr\u00fcn.<\/li>\n<li>Ayarlara ra\u011fmen bo\u015f bellek kalm\u0131yorsa RAM&#8217;i y\u00fckseltin.<\/li>\n<\/ol>\n<\/div>\n<table class=\"kb-uyg\">\n<tr>\n<th>Panel<\/th>\n<td>Yok \u2014 VPS\/VDS y\u00f6netimsizdir; te\u015fhis sunucunuzda SSH ile yap\u0131l\u0131r<\/td>\n<\/tr>\n<tr>\n<th>Sistem<\/th>\n<td>Ubuntu 22.04\/24.04, Debian 12, AlmaLinux 8\/9, Rocky 9<\/td>\n<\/tr>\n<tr>\n<th>Yetki<\/th>\n<td>root ya da sudo yetkili kullan\u0131c\u0131<\/td>\n<\/tr>\n<tr>\n<th>Narhost \u00fcr\u00fcn\u00fc<\/th>\n<td><a href=\"https:\/\/narhost.com\/vps-sunucu\" title=\"Narhost VPS Sunucu paketleri\">VPS Sunucu<\/a>, VDS Sunucu<\/td>\n<\/tr>\n<\/table>\n<div class=\"kb-once\">\n<p class=\"label\">Ba\u015flamadan \u00f6nce<\/p>\n<ul>\n<li>Servisin durdu\u011fu saati not edin; \u00e7ekirdek g\u00fcnl\u00fc\u011f\u00fcnde o saate bakacaks\u0131n\u0131z.<\/li>\n<li>De\u011fi\u015ftirece\u011finiz yap\u0131land\u0131rma dosyalar\u0131n\u0131n (PHP-FPM havuzu, MySQL) yede\u011fini al\u0131n.<\/li>\n<li>Sunucu yan\u0131t vermiyorsa SSH yerine taray\u0131c\u0131 terminali ya da konsoldan ba\u011flan\u0131n.<\/li>\n<\/ul>\n<\/div>\n<h2>Linux Out of Memory Neden Olur<\/h2>\n<p>Linux, s\u00fcre\u00e7lere fiziksel bellekten fazlas\u0131n\u0131 vaat edebilir (overcommit). S\u00fcre\u00e7ler bu vaadi ayn\u0131 anda kullanmaya kalk\u0131nca ve swap da dolunca \u00e7ekirdek sistemi ayakta tutmak i\u00e7in bir s\u00fcreci se\u00e7ip \u00f6ld\u00fcr\u00fcr. Se\u00e7im her s\u00fcrecin bellek kullan\u0131m\u0131ndan hesaplanan <code>oom_score<\/code> de\u011ferine g\u00f6re yap\u0131l\u0131r; genellikle en b\u00fcy\u00fck s\u00fcre\u00e7, yani MySQL\/MariaDB, PHP-FPM ya da Java uygulamas\u0131 gider. Ayarlar\u0131n tamam\u0131 <a href=\"https:\/\/docs.kernel.org\/admin-guide\/sysctl\/vm.html\" title=\"Linux \u00e7ekirde\u011fi resm\u00ee dok\u00fcman\u0131 \u2014 \/proc\/sys\/vm (overcommit ve OOM ayarlar\u0131)\" target=\"_blank\" rel=\"noopener\">\u00e7ekirde\u011fin vm dok\u00fcman\u0131nda<\/a> anlat\u0131l\u0131r.<\/p>\n<p>Tipik tablo: gece yedek beti\u011fi ya da bot trafi\u011fi s\u0131ras\u0131nda PHP-FPM s\u00fcre\u00e7 say\u0131s\u0131 artar, her biri y\u00fczlerce MB tutar, veritaban\u0131 arabelle\u011fi de RAM&#8217;in b\u00fcy\u00fck k\u0131sm\u0131n\u0131 ay\u0131rm\u0131\u015ft\u0131r. Swap&#8217;\u0131 olmayan k\u00fc\u00e7\u00fck bir VPS&#8217;te bu birka\u00e7 saniyede OOM ile biter.<\/p>\n<h2>Ad\u0131m Ad\u0131m Te\u015fhis ve \u00c7\u00f6z\u00fcm<\/h2>\n<h3>1. Hangi s\u00fcre\u00e7 \u00f6ld\u00fcr\u00fcld\u00fc<\/h3>\n<ol class=\"kb-adimlar\">\n<li><strong>\u00c7ekirdek g\u00fcnl\u00fc\u011f\u00fcn\u00fc taray\u0131n:<\/strong>\n<pre><code class=\"language-bash\">sudo dmesg -T | grep -iE \"out of memory|killed process\"\nsudo journalctl -k --since \"2 days ago\" | grep -i \"killed process\"<\/code><\/pre>\n<p class=\"kb-cikti\">Beklenen sonu\u00e7: <code>Out of memory: Killed process 1234 (mysqld) total-vm:...kB, anon-rss:...kB<\/code> bi\u00e7iminde bir sat\u0131r. Parantez i\u00e7i s\u00fcre\u00e7 ad\u0131, <code>anon-rss<\/code> ise \u00f6ld\u00fcr\u00fcld\u00fc\u011f\u00fc andaki ger\u00e7ek bellek kullan\u0131m\u0131d\u0131r.<\/p>\n<\/li>\n<li><strong>Sunucu yeniden ba\u015flad\u0131ysa \u00f6nceki a\u00e7\u0131l\u0131\u015fa bak\u0131n:<\/strong>\n<pre><code class=\"language-bash\">sudo journalctl -k -b -1 | grep -i \"out of memory\"<\/code><\/pre>\n<p class=\"kb-cikti\">Beklenen sonu\u00e7: kal\u0131c\u0131 g\u00fcnl\u00fck a\u00e7\u0131ksa bir \u00f6nceki a\u00e7\u0131l\u0131\u015f\u0131n OOM sat\u0131rlar\u0131; ayr\u0131nt\u0131l\u0131 okuma i\u00e7in <a href=\"https:\/\/narhost.com\/destek\/linux-log-dosyalari-nasil-okunur\/\" title=\"Linux Sunucu Log Dosyalar\u0131 Nerede, Nas\u0131l Okunur (journalctl, \/var\/log) \u2014 Narhost Destek\">log dosyalar\u0131 kart\u0131na<\/a> bak\u0131n.<\/p>\n<\/li>\n<\/ol>\n<h3>2. Belle\u011fi kim kullan\u0131yor<\/h3>\n<ol class=\"kb-adimlar\">\n<li><strong>Genel durumu ve en b\u00fcy\u00fck s\u00fcre\u00e7leri g\u00f6r\u00fcn:<\/strong>\n<pre><code class=\"language-bash\">free -h\nps aux --sort=-%mem | head -n 10<\/code><\/pre>\n<p class=\"kb-cikti\">Beklenen sonu\u00e7: <code>free<\/code> \u00e7\u0131kt\u0131s\u0131nda <code>available<\/code> s\u00fctunu ger\u00e7ekten kullan\u0131labilir belle\u011fi, <code>Swap<\/code> sat\u0131r\u0131 swap alan\u0131n\u0131 g\u00f6sterir. <code>0B<\/code> ise swap yoktur. Canl\u0131 izleme i\u00e7in <a href=\"https:\/\/narhost.com\/destek\/top-htop-ile-kaynak-izleme\/\" title=\"top ve htop ile Sunucu CPU\/RAM Kullan\u0131m\u0131 Nas\u0131l \u0130zlenir \u2014 Narhost Destek\">top ve htop<\/a> kullan\u0131n.<\/p>\n<\/li>\n<\/ol>\n<h3>3. Belle\u011fi s\u0131n\u0131rlay\u0131n<\/h3>\n<ol class=\"kb-adimlar\">\n<li><strong>Swap ekleyin.<\/strong> Swap RAM&#8217;in yerini tutmaz ama ani zirvede s\u00fcre\u00e7lerin \u00f6ld\u00fcr\u00fclmesini geciktirir; ad\u0131mlar <a href=\"https:\/\/narhost.com\/destek\/swap-alani-nasil-olusturulur\/\" title=\"Swap Alan\u0131 Nas\u0131l Olu\u015fturulur (VPS \u0130lk Kurulum 7\/10) \u2014 Narhost Destek\">swap alan\u0131 kart\u0131nda<\/a>.<\/li>\n<li><strong>PHP-FPM s\u00fcre\u00e7 say\u0131s\u0131n\u0131 RAM&#8217;e g\u00f6re ayarlay\u0131n.<\/strong> Ubuntu 24.04&#8217;te <code>\/etc\/php\/8.3\/fpm\/pool.d\/www.conf<\/code> dosyas\u0131ndaki <code>pm.max_children<\/code> de\u011feri, PHP&#8217;ye ay\u0131rd\u0131\u011f\u0131n\u0131z belle\u011fin bir s\u00fcrecin ortalama boyutuna b\u00f6l\u00fcm\u00fcn\u00fc ge\u00e7memelidir:\n<pre><code class=\"language-bash\">ps -C php-fpm8.3 -o rss= | awk '{s+=$1; n++} END {print s\/n\/1024 \" MB\"}'<\/code><\/pre>\n<p class=\"kb-cikti\">Beklenen sonu\u00e7: s\u00fcre\u00e7 ba\u015f\u0131na ortalama MB. \u00d6rne\u011fin PHP&#8217;ye 2 GB ay\u0131rd\u0131ysan\u0131z ve s\u00fcre\u00e7 80 MB ise <code>pm.max_children = 25<\/code> \u00fcst s\u0131n\u0131rd\u0131r.<\/p>\n<\/li>\n<li><strong>Veritaban\u0131 arabelle\u011fini k\u00fc\u00e7\u00fclt\u00fcn.<\/strong><code>innodb_buffer_pool_size<\/code> de\u011feri, web sunucusu da ayn\u0131 makinedeyse toplam RAM&#8217;in yar\u0131s\u0131n\u0131 ge\u00e7mesin; ba\u011flant\u0131 say\u0131s\u0131 da bellekle birlikte hesaplan\u0131r.<\/li>\n<li><strong>Kritik servisi koruyun (iste\u011fe ba\u011fl\u0131).<\/strong><code>sudo systemctl edit mariadb<\/code> ile a\u00e7\u0131lan dosyaya yaz\u0131n:\n<pre><code class=\"language-ini\">[Service]\nOOMScoreAdjust=-500<\/code><\/pre>\n<p class=\"kb-cikti\">Beklenen sonu\u00e7: <code>sudo systemctl restart mariadb<\/code> sonras\u0131 \u00e7ekirdek \u00f6nce ba\u015fka s\u00fcre\u00e7leri se\u00e7er. Bu sorunu \u00e7\u00f6zmez, yaln\u0131z kurban\u0131 de\u011fi\u015ftirir.<\/p>\n<\/li>\n<\/ol>\n<figure class=\"nh-sema\"><img src=\"https:\/\/narhost.com\/destek\/wp-content\/uploads\/2026\/09\/linux-out-of-memory-hatasi-sema-narhost.webp\" alt=\"Linux out of memory te\u015fhis \u015femas\u0131 \u2014 \u00e7ekirdek g\u00fcnl\u00fc\u011f\u00fcn\u00fc okuma, bellek kullan\u0131m\u0131n\u0131 g\u00f6rme, servis s\u0131n\u0131rlar\u0131n\u0131 ayarlama ve RAM karar\u0131\" width=\"1200\" height=\"500\" loading=\"lazy\" decoding=\"async\"><figcaption>G\u00fcnl\u00fckten kurban\u0131 bulun, belle\u011fi kimin tuttu\u011funu g\u00f6r\u00fcn, s\u0131n\u0131rlar\u0131 RAM&#x27;e g\u00f6re \u00e7izin.<\/figcaption><\/figure>\n<h2>Do\u011frulama<\/h2>\n<div class=\"success-box\">\n<p class=\"label\">Sonu\u00e7<\/p>\n<p>Ayarlardan sonra yo\u011fun saatlerde <code>free -h<\/code> \u00e7\u0131kt\u0131s\u0131nda <code>available<\/code> de\u011feri toplam RAM&#8217;in belirgin bir k\u0131sm\u0131 olarak kal\u0131yor ve <code>dmesg -T<\/code> yeni bir <code>Killed process<\/code> sat\u0131r\u0131 g\u00f6stermiyorsa sorun \u00e7\u00f6z\u00fclm\u00fc\u015ft\u00fcr. Birka\u00e7 g\u00fcn boyunca ayn\u0131 kontrol\u00fc tekrarlay\u0131n.<\/p>\n<\/div>\n<h2>H\u00e2l\u00e2 \u00c7\u00f6z\u00fclmediyse<\/h2>\n<ul>\n<li><strong>Swap s\u00fcrekli dolu, sunucu yava\u015f.<\/strong><code>vmstat 1<\/code> \u00e7\u0131kt\u0131s\u0131nda <code>si<\/code>\/<code>so<\/code> s\u00fctunlar\u0131 s\u00fcrekli s\u0131f\u0131rdan b\u00fcy\u00fckse RAM ger\u00e7ekten yetmiyordur; ayar de\u011fil kapasite sorunudur.<\/li>\n<li><strong>Tek bir s\u00fcre\u00e7 durmadan b\u00fcy\u00fcyor.<\/strong> Uygulamada bellek s\u0131z\u0131nt\u0131s\u0131 olabilir; servisi <a href=\"https:\/\/narhost.com\/destek\/linux-servisini-durdurma-ve-aktif-etme\/\" title=\"Linux&#039;ta Servis Nas\u0131l Durdurulur ve Aktif Edilir (systemctl) \u2014 Narhost Destek\">yeniden ba\u015flatmak<\/a> ge\u00e7ici \u00e7\u00f6z\u00fcmd\u00fcr, kal\u0131c\u0131 \u00e7\u00f6z\u00fcm uygulama taraf\u0131ndad\u0131r.<\/li>\n<li><strong>Ne kadar RAM gerekti\u011fini bilmiyorsunuz.<\/strong><a href=\"https:\/\/narhost.com\/blog\/vps-ne-kadar-ram-cpu-gerekir\/\" title=\"VPS \u0130\u00e7in Ne Kadar RAM ve CPU Gerekir \u2014 Narhost Blog\">VPS i\u00e7in ne kadar RAM gerekir<\/a> yaz\u0131s\u0131ndaki hesapla paketinizi kar\u015f\u0131la\u015ft\u0131r\u0131n.<\/li>\n<\/ul>\n<div class=\"cta-box\">\n<p class=\"label\">Narhost deste\u011fi<\/p>\n<p>Talebe \u015funlar\u0131 ekleyin: sunucunuzun IP adresi, <code>dmesg<\/code> \u00e7\u0131kt\u0131s\u0131ndaki OOM sat\u0131r\u0131, <code>free -h<\/code> \u00e7\u0131kt\u0131s\u0131 ve olay\u0131n saati. Sunucu i\u00e7i ayarlar sizin y\u00f6netiminizdedir; paket y\u00fckseltme i\u00e7in de talep a\u00e7abilirsiniz.<\/p>\n<p><a class=\"cta-btn\" href=\"https:\/\/narhost.com\/submitticket.php\" title=\"Narhost destek talebi a\u00e7\">Destek talebi a\u00e7<\/a><\/div>\n<div class=\"kb-ilgili\">\n<p class=\"label\">Sonraki ad\u0131mlar<\/p>\n<ul>\n<li><a href=\"https:\/\/narhost.com\/destek\/vps-vds-ilk-kurulum-rehberi\/\" title=\"VPS VDS Sunucu \u0130lk Kurulum Rehberi (10 Ad\u0131mda G\u00fcvenli Kurulum) \u2014 Narhost Destek\">VPS VDS ilk kurulum rehberi<\/a><\/li>\n<li><a href=\"https:\/\/narhost.com\/destek\/sistem-bellegi-ram-takibi-nasil-yapilir\/\" title=\"Linux RAM Kullan\u0131m\u0131 Nas\u0131l \u0130zlenir (free, top, htop) \u2014 Narhost Destek\">Linux RAM kullan\u0131m\u0131n\u0131 izleme<\/a><\/li>\n<li><a href=\"https:\/\/narhost.com\/destek\/swap-alani-nasil-olusturulur\/\" title=\"Swap Alan\u0131 Nas\u0131l Olu\u015fturulur (VPS \u0130lk Kurulum 7\/10) \u2014 Narhost Destek\">Swap alan\u0131 olu\u015fturma<\/a><\/li>\n<li><a href=\"https:\/\/narhost.com\/destek\/vds-aldim-ama-kasiyor-ne-yapmaliyim\/\" title=\"VDS Ald\u0131ktan Sonra Yava\u015fl\u0131k (Kasma) Sorunu Nas\u0131l Giderilir \u2014 Narhost Destek\">VDS yava\u015fl\u0131k sorunu<\/a><\/li>\n<\/ul>\n<\/div>\n<div class=\"kb-faq\">\n<h2>S\u0131k\u00e7a sorulan sorular<\/h2>\n<h3>Linux out of memory olay\u0131n\u0131 \u00f6nceden fark edebilir miyim?<\/h3>\n<p>Evet. <code>available<\/code> de\u011ferini ve swap kullan\u0131m\u0131n\u0131 d\u00fczenli izleyin; bellek toplam\u0131n k\u00fc\u00e7\u00fck bir k\u0131sm\u0131na d\u00fc\u015ft\u00fc\u011f\u00fcnde uyar\u0131 veren basit bir izleme beti\u011fi ya da ara\u00e7 kurmak, OOM&#8217;dan \u00f6nce m\u00fcdahale etme \u015fans\u0131 verir.<\/p>\n<h3>OOM killer&#8217;\u0131 kapatmak mant\u0131kl\u0131 m\u0131?<\/h3>\n<p>Hay\u0131r. Kapat\u0131ld\u0131\u011f\u0131nda bellek bitti\u011finde sunucu tamamen kilitlenir ya da \u00e7ekirdek pani\u011fe d\u00fc\u015fer. Do\u011fru yol s\u00fcre\u00e7lerin bellek s\u0131n\u0131r\u0131n\u0131 ayarlamakt\u0131r.<\/p>\n<h3>Swap eklemek RAM y\u00fckseltmenin yerini tutar m\u0131?<\/h3>\n<p>Tutmaz. Swap diskte oldu\u011fu i\u00e7in RAM&#8217;den \u00e7ok yava\u015ft\u0131r; k\u0131sa zirveleri kar\u015f\u0131lar, s\u00fcrekli ihtiya\u00e7ta sunucuyu yava\u015flat\u0131r.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Linux OOM killer hatas\u0131: dmesg ve journalctl&#8217;da Out of memory: Killed process sat\u0131r\u0131n\u0131 okuma, free -h ve ps ile bellek kullan\u0131m\u0131n\u0131 g\u00f6rme, swap ekleme, PHP-FPM pm.max_children ve innodb_buffer_pool_size ayar\u0131, OOMScoreAdjust ve RAM y\u00fckseltme karar\u0131.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[302],"class_list":["post-2482","post","type-post","status-publish","format-standard","hentry","category-vps-server","tag-bellek"],"meta_box":[],"_links":{"self":[{"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/posts\/2482","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/comments?post=2482"}],"version-history":[{"count":1,"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/posts\/2482\/revisions"}],"predecessor-version":[{"id":2857,"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/posts\/2482\/revisions\/2857"}],"wp:attachment":[{"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/media?parent=2482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/categories?post=2482"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/tags?post=2482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}