Drop_caches, tsaftace ƙwaƙwalwar RAM akan tsarin ku daga tashar

Game da wuraren saukarwa

A talifi na gaba zamu ga yadda tsabtace RAM daga tashar Ubuntu. Ta hanyar tsoho, Gnu / Linux suna da ingantacciyar hanyar sarrafa RAM akan kwamfutocinmu. Tare da wannan zamu sami ingantaccen aiki na albarkatun da ke cikin tsarinmu. Wannan hanyar zata iya rikita masu amfani a wasu lokuta kamar yadda RAM take kamar ta cinyeta duk da rufe dukkan aikace-aikacen.

Gnu / Linux suna amfani da wadataccen ƙwaƙwalwar ajiya don ɓoye aikace-aikace daga rumbun kwamfutarka, tare da manufar cimma saurin karantawa. Wannan fa'idar ta zama ƙwarewar damuwa, musamman ga masu gudanar da tsarin waɗanda ke magance matsalolin PC. Canje-canjen da ake amfani da su akan fayilolin tsarin a kan diski mai wuya ba za a karanta su ba. Wannan na faruwa ne saboda Gnu / Linux suna ɗora su daga RAM. Saboda haka, don gyara wannan matsalar, yana da kyau tsabtace RAM maimakon sake kunna kwamfutar.

Tsabtace RAM a cikin Ubuntu, Linux Mint da abubuwan ban sha'awa tare da drop_caches

Za mu fara tashar (Ctrl + Alt T) kuma rubuta waɗannan dokokin:

drop_caches gudu a cikin m

sudo su

sync; echo 3 > /proc/sys/vm/drop_caches

Don fara mu bari mu shiga azaman tushe. Sannan umarnin 'Gama aiki'zuwa tsabtace fayilolin fayiloli. Ta wannan hanyar, za mu tabbata cewa duk abubuwan da aka adana an sake su. In ba haka ba za a iya samun matsaloli. Umurnin 'Kira'yayi aikin rubutu ga fayil din kuma drop_caches yana share ma'ajin ba tare da cire kowane app / sabis ba. Ya kamata kai tsaye ka ga cewa RAM ya sami 'yanci.

Idan ya zama dole ku share ma'ajiyar diski, "… Amsa kuwwa> 3…”Ya fi aminci a cikin kamfani da cikin kayan aiki a cikin aikin samarwa tun daga lokacin«Amsa kuwwa 1>….»Zai share shafi kawai. Ba a ba da shawarar yin amfani da zaɓi na uku ba «Cho amsa kuwwa 3>…»A cikin samarwa har sai kun san me kuke yi, tunda zai share ma'ajiyar shafi, hakoran hakora, da inodes. Zaɓin "… Amsa kuwwa 0>…»Ba zai saki komai ba, kuma zaɓi«… Amsa kuwwa 2>…»Zai kyauta ne kawai a ciki da haƙori.

Wannan aiki zai iya rage tsarin na wasu secondsan dakiku, yayin da aka share cache kuma duk albarkatun da OS ke buƙata an ɗora su a cikin ɗakin ajiya.

An tsara Gnu / Linux ta yadda zai bincika ɓoyayyen diski kafin bincika faifan. Idan ya sami kayan aiki a cikin akwatin, to buƙatar ba zata buga faifai ba. Idan muka share ma'ajiyar, tsarin aiki zai bincika kayan da aka nema akan faifai.

Releaseaddamar da RAM ta atomatik ta amfani da ayyukan Cron

Yanzu da yake mun san yadda ake 'yantar da ƙwaƙwalwa a kan kwamfutocinmu, za mu iya so a yi aiki da kai yadda ake goge ƙwaƙwalwar a kai a kai. Wannan za a iya samun sauƙin yi ta ayyukan cron. Ya kamata ayi amfani da wannan aikin kawai akan tebur da kwamfutocin tafi-da-gidanka.

Mataki na 1

Don farawa, zamu fara tashar (Ctrl + Alt + T) kuma rubuta umarnin mai zuwa zuwa shigar vim, ko kuma cewa kowa yana amfani da editan da ya fi so:

sudo apt-get install vim

Mataki na 2

Yanzu zamu kirkiro .sh fayil ake kira eraseram.sh. A ciki, zamu ƙara rubutun:

vim borraram.sh

Mataki na 3

sau_kashewa vim

Idan muka yi amfani da vim edita, dole ne mu yi latsa mabuɗin 'esc' sannan mabuɗin 'i' don shigar da yanayin Saka. Gaba, zamu ƙara rubutun mai zuwa.

#!/bin/bash
sync
echo "echo 3 > /proc/sys/vm/drop_caches"

Layi na farko a ƙasa shine shebang. Sannan zamu rubuta irin umarnin da muke amfani dashi don goge RAM daga tashar.

Da zarar an rubuta komai, zamu adana fayil ɗin sh kuma zamu fita daga editan rubutu vim. Don yin wannan zamu danna 'esc' za mu rubuta : wq kuma za mu danna Shigar. Vim zai adana fayil ɗin sh kuma ya fita zuwa tashar. Don wannan misalin na aje rubutun a cikin babban fayil na gida.

Mataki na 4

Koma cikin tashar, zamu rubuta umarnin mai zuwa zuwa bayar da izini na karanta / rubuta:

sudo chmod 755 borraram.sh

Mataki na 5

Yanzu lokaci yayi da za mu kira umarnin crontab:

sudo crontab -e

Mataki na 6

drop_caches cron aiki

A ce muna so share RAM kowace rana a 1 PM. Wannan ga kowa da kowa.

0 13 * * * /root/scripts/borraram.sh

Fayil din sh, zamu iya matsar dashi zuwa wurin da muke so, amma dole ne mu tuna hanyar tunda wannan shine zamu bayar ga umarnin da ya gabata.


Bar tsokaci

Your email address ba za a buga. Bukata filayen suna alama da *

*

*

  1. Wanda ke da alhakin bayanan: Miguel Ángel Gatón
  2. Manufar bayanan: Sarrafa SPAM, sarrafa sharhi.
  3. Halacci: Yarda da yarda
  4. Sadarwar bayanan: Ba za a sanar da wasu bayanan ga wasu kamfanoni ba sai ta hanyar wajibcin doka.
  5. Ajiye bayanai: Bayanin yanar gizo wanda Occentus Networks (EU) suka dauki nauyi
  6. Hakkoki: A kowane lokaci zaka iyakance, dawo da share bayanan ka.

      Ricardo Melgoza m

    Rosita Melgoza tana neman ku don ganin abin da ya dace da ku. Tambayi malaminku menene OS ɗin da zaku girka

      syslog m

    Ya kamata a share wannan sakon, ya ƙunshi bayanai da yawa da ba daidai ba. Ba'a ba da shawarar share rumbun diski ba, wannan ba ya taimaka wa mai amfani na ƙarshe kwata-kwata. Har ila yau, ƙarya ne "wannan fa'idar ta zama abin ƙwarewa, musamman ga masu kula da tsarin waɗanda ke magance matsalolin PC", saboda ??? Haka kuma ba a bayyana dalilin da ya sa kuke yin aiki tare ba, ... labarin ne mai rikitarwa da kuskure.