{"id":78,"date":"2013-12-29T02:50:16","date_gmt":"2013-12-29T01:50:16","guid":{"rendered":"http:\/\/ts3index.com\/blog\/?p=78"},"modified":"2016-03-31T21:57:14","modified_gmt":"2016-03-31T20:57:14","slug":"speichercaches-von-linux-leeren","status":"publish","type":"post","link":"https:\/\/ts3index.com\/blog\/en\/78-empty-memory-caches-of-linux\/","title":{"rendered":"Empty memory caches of Linux"},"content":{"rendered":"<p>Der 2.6er Kernel bietet die M\u00f6glichkeit den Speichercaches des Filesystems freizugeben. Im Normalfall funktioniert das Speichermanagement von Linux problemlos, manchmal kann man jedoch Hand anlegen. \u00dcber den Sinn dieser Funktion kann man sich streiten, doch eigentlich ist die Funktion f\u00fcr Debugging und Programmieren gedacht.<!--more--><\/p>\n<p>Der Arbeitsspeicher des Linux internen Speichermanagements kann nur durch ein Reboot oder mit ein paar Befehlen freigegeben werden. Durch top k\u00f6nnen die speziellen Caches nicht gesondert angezeigt werden. Eine Alternative ist htop, es zeigt den verwendeten Speicher an und kann mit <code>apt-get install htop<\/code> auf dem System installiert werden.<\/p>\n<p>Sinn, den Cache auf einem Produktivsystem zu leeren, macht es nicht &#8211; im Gegenteil. Die Seiten, die vorher im Cache lagerten, m\u00fcssen bei einem erneutem Zugriff wieder von der langsamen Festplatte geholt werden.<\/p>\n<p><strong>Hinweis:<\/strong> Diese Befehle nur ausf\u00fchren, wenn wirklich noch genug Speicher zur Verf\u00fcgung steht. Andernfalls ist mit einem Systemabsturz zu rechnen. Vor der Aufr\u00e4umaktion sollte mit <code>sync<\/code> der Speicher auf die Festplatte geschrieben werden.<\/p>\n<p><em><strong>Es gibt folgende M\u00f6glichkeiten:<\/strong><\/em><\/p>\n<p>1. Mit Pages, die \u00fcber einen Eintrag auf der Festplatte verf\u00fcgen, werden im schnellen RAM vorgehalten. Der Pagecache kann mit folgendem Befehl geleert werden:<\/p>\n<pre>echo 1 &gt; \/proc\/sys\/vm\/drop_caches<\/pre>\n<p>2. Durch Dentrie- und Inodecache\u00a0 wird ein Dateisystem im Speicher abgebildet. Dieser kann mit folgendem Befehl geleert werden:<\/p>\n<pre>echo 2 &gt; \/proc\/sys\/vm\/drop_caches<\/pre>\n<p>3. Der komplette Cache (Page-, Dentrie- und Inodecache) l\u00e4sst sich\u00a0mit folgendem Befehl leeren:<\/p>\n<pre>echo 3 &gt; \/proc\/sys\/vm\/drop_caches<\/pre>\n<p>Es kommt vor, dass auch Swap in Benutzung ist, obwohl genug freier Speicher zu Verf\u00fcgung steht. Der Swap-Speicher kann mit folgendem Befehl geleert werden:<\/p>\n<pre>swapoff -a &amp;&amp; swapon -a<\/pre>\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>Sorry, this entry is only available in German.<\/p>\n","protected":false},"author":1,"featured_media":224,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[88],"tags":[30,32,35,36,23,34,31,14,33,37],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Empty memory caches of Linux<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/ts3index.com\/blog\/?p=78\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Empty memory caches of Linux\" \/>\n<meta property=\"og:description\" content=\"Sorry, this entry is only available in German.\" \/>\n<meta property=\"og:url\" content=\"http:\/\/ts3index.com\/blog\/?p=78\" \/>\n<meta property=\"og:site_name\" content=\"TS3index.com Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/ts3index\" \/>\n<meta property=\"article:published_time\" content=\"2013-12-29T01:50:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-03-31T20:57:14+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/ts3index.com\/blog\/wp-content\/uploads\/2013\/12\/Speichercaches-von-Linux-leeren.png\" \/>\n\t<meta property=\"og:image:width\" content=\"520\" \/>\n\t<meta property=\"og:image:height\" content=\"245\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"TS3index.com\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TS3index.com\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/ts3index.com\/blog\/?p=78#article\",\"isPartOf\":{\"@id\":\"http:\/\/ts3index.com\/blog\/?p=78\"},\"author\":{\"name\":\"TS3index.com\",\"@id\":\"http:\/\/ts3index.com\/blog\/#\/schema\/person\/ddaa3254c1cef894c9c3140cde198f91\"},\"headline\":\"Empty memory caches of Linux\",\"datePublished\":\"2013-12-29T01:50:16+00:00\",\"dateModified\":\"2016-03-31T20:57:14+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/ts3index.com\/blog\/?p=78\"},\"wordCount\":507,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/ts3index.com\/blog\/#organization\"},\"keywords\":[\"Arbeitsspeicher\",\"Cache\",\"Dentriecache\",\"Inodecache\",\"Linux\",\"Pagecache\",\"RAM\",\"Server\",\"Speichermanagement\",\"Swap\"],\"articleSection\":[\"Linux\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/ts3index.com\/blog\/?p=78\",\"url\":\"http:\/\/ts3index.com\/blog\/?p=78\",\"name\":\"Empty memory caches of Linux\",\"isPartOf\":{\"@id\":\"http:\/\/ts3index.com\/blog\/#website\"},\"datePublished\":\"2013-12-29T01:50:16+00:00\",\"dateModified\":\"2016-03-31T20:57:14+00:00\",\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/ts3index.com\/blog\/?p=78\"]}]},{\"@type\":\"WebSite\",\"@id\":\"http:\/\/ts3index.com\/blog\/#website\",\"url\":\"http:\/\/ts3index.com\/blog\/\",\"name\":\"TS3index.com Blog\",\"description\":\"News, Questions &amp; Answers\",\"publisher\":{\"@id\":\"http:\/\/ts3index.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/ts3index.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\/\/ts3index.com\/blog\/#organization\",\"name\":\"TS3index.com\",\"url\":\"http:\/\/ts3index.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/ts3index.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/ts3index.com\/blog\/wp-content\/uploads\/2013\/12\/ts3index_com_hosting_logo.png\",\"contentUrl\":\"https:\/\/ts3index.com\/blog\/wp-content\/uploads\/2013\/12\/ts3index_com_hosting_logo.png\",\"width\":125,\"height\":161,\"caption\":\"TS3index.com\"},\"image\":{\"@id\":\"http:\/\/ts3index.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/ts3index\",\"https:\/\/twitter.com\/ts3index\"]},{\"@type\":\"Person\",\"@id\":\"http:\/\/ts3index.com\/blog\/#\/schema\/person\/ddaa3254c1cef894c9c3140cde198f91\",\"name\":\"TS3index.com\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\/\/ts3index.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cf4450657d51a136b9d89c7b2d43c6a7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cf4450657d51a136b9d89c7b2d43c6a7?s=96&d=mm&r=g\",\"caption\":\"TS3index.com\"},\"url\":\"https:\/\/ts3index.com\/blog\/en\/author\/ts3index\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Empty memory caches of Linux","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":"http:\/\/ts3index.com\/blog\/?p=78","og_locale":"en_US","og_type":"article","og_title":"Empty memory caches of Linux","og_description":"Sorry, this entry is only available in German.","og_url":"http:\/\/ts3index.com\/blog\/?p=78","og_site_name":"TS3index.com Blog","article_publisher":"https:\/\/www.facebook.com\/ts3index","article_published_time":"2013-12-29T01:50:16+00:00","article_modified_time":"2016-03-31T20:57:14+00:00","og_image":[{"width":520,"height":245,"url":"http:\/\/ts3index.com\/blog\/wp-content\/uploads\/2013\/12\/Speichercaches-von-Linux-leeren.png","type":"image\/png"}],"author":"TS3index.com","twitter_misc":{"Written by":"TS3index.com","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/ts3index.com\/blog\/?p=78#article","isPartOf":{"@id":"http:\/\/ts3index.com\/blog\/?p=78"},"author":{"name":"TS3index.com","@id":"http:\/\/ts3index.com\/blog\/#\/schema\/person\/ddaa3254c1cef894c9c3140cde198f91"},"headline":"Empty memory caches of Linux","datePublished":"2013-12-29T01:50:16+00:00","dateModified":"2016-03-31T20:57:14+00:00","mainEntityOfPage":{"@id":"http:\/\/ts3index.com\/blog\/?p=78"},"wordCount":507,"commentCount":0,"publisher":{"@id":"http:\/\/ts3index.com\/blog\/#organization"},"keywords":["Arbeitsspeicher","Cache","Dentriecache","Inodecache","Linux","Pagecache","RAM","Server","Speichermanagement","Swap"],"articleSection":["Linux"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"http:\/\/ts3index.com\/blog\/?p=78","url":"http:\/\/ts3index.com\/blog\/?p=78","name":"Empty memory caches of Linux","isPartOf":{"@id":"http:\/\/ts3index.com\/blog\/#website"},"datePublished":"2013-12-29T01:50:16+00:00","dateModified":"2016-03-31T20:57:14+00:00","inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/ts3index.com\/blog\/?p=78"]}]},{"@type":"WebSite","@id":"http:\/\/ts3index.com\/blog\/#website","url":"http:\/\/ts3index.com\/blog\/","name":"TS3index.com Blog","description":"News, Questions &amp; Answers","publisher":{"@id":"http:\/\/ts3index.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/ts3index.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/ts3index.com\/blog\/#organization","name":"TS3index.com","url":"http:\/\/ts3index.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/ts3index.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/ts3index.com\/blog\/wp-content\/uploads\/2013\/12\/ts3index_com_hosting_logo.png","contentUrl":"https:\/\/ts3index.com\/blog\/wp-content\/uploads\/2013\/12\/ts3index_com_hosting_logo.png","width":125,"height":161,"caption":"TS3index.com"},"image":{"@id":"http:\/\/ts3index.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/ts3index","https:\/\/twitter.com\/ts3index"]},{"@type":"Person","@id":"http:\/\/ts3index.com\/blog\/#\/schema\/person\/ddaa3254c1cef894c9c3140cde198f91","name":"TS3index.com","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/ts3index.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cf4450657d51a136b9d89c7b2d43c6a7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cf4450657d51a136b9d89c7b2d43c6a7?s=96&d=mm&r=g","caption":"TS3index.com"},"url":"https:\/\/ts3index.com\/blog\/en\/author\/ts3index\/"}]}},"_links":{"self":[{"href":"https:\/\/ts3index.com\/blog\/en\/wp-json\/wp\/v2\/posts\/78"}],"collection":[{"href":"https:\/\/ts3index.com\/blog\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ts3index.com\/blog\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ts3index.com\/blog\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ts3index.com\/blog\/en\/wp-json\/wp\/v2\/comments?post=78"}],"version-history":[{"count":16,"href":"https:\/\/ts3index.com\/blog\/en\/wp-json\/wp\/v2\/posts\/78\/revisions"}],"predecessor-version":[{"id":514,"href":"https:\/\/ts3index.com\/blog\/en\/wp-json\/wp\/v2\/posts\/78\/revisions\/514"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ts3index.com\/blog\/en\/wp-json\/wp\/v2\/media\/224"}],"wp:attachment":[{"href":"https:\/\/ts3index.com\/blog\/en\/wp-json\/wp\/v2\/media?parent=78"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ts3index.com\/blog\/en\/wp-json\/wp\/v2\/categories?post=78"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ts3index.com\/blog\/en\/wp-json\/wp\/v2\/tags?post=78"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}