SlideShare a Scribd company logo
Clear Memory Cache on Ubuntu
I'am use backtrack 5 R2 linux operating system, sometime my computer often find my memory full
using process and services system. Here I will share trick to make efficient memory management
system with clear memory, as like other article almost the same for the script using. My computer
specification version detail as below :
root@bt:/opt/nessus/sbin# lscpu
Architecture: i686
CPU op-mode(s): 64-bit
CPU(s): 2
Thread(s) per core: 1
Core(s) per socket: 2
CPU socket(s): 1
Vendor ID: AuthenticAMD
CPU family: 20
Model: 2
Stepping: 0
CPU MHz: 780.000
Virtualization: AMD-V
L1d cache: 32K
L1i cache: 32K
L2 cache: 512K
And details using kernel Linux bt 2.6.39.4 / i686 GNU/Linux.
Show Memory Process
the computer has memory process are running on operating system, we can check using some
command the following :
counting total service on system :
root@bt:service --status-all | wc -l
[ ? ] vboxdrv
[ ? ] vboxweb-service
[ ? ] vmware-USBArbitrator
[ ? ] wpa-ifupdown
27
And information details process memory using command top are result as below :
top - 11:20:00 up 4:25, 6 users, load average: 0.26, 0.72, 0.81
Tasks: 177 total, 2 running, 173 sleeping, 0 stopped, 2 zombie
Cpu(s): 31.3%us, 7.8%sy, 1.8%ni, 57.3%id, 1.3%wa, 0.0%hi, 0.5%si, 0.0%st
Mem: 3612432k total, 3486996k used, 125436k free, 283264k buffers
Swap: 2353516k total, 548k used, 2352968k free, 1547248k cached
information peak memory usage :
root@bt:/usr/bin/time -v ls /
bin cdrom etc initrd.img lost+found mnt opt proc sbin share sys usr vmlinuz
boot dev home lib media NONE pentest root selinux srv tmp var
Command being timed: "ls /"
User time (seconds): 0.00
System time (seconds): 0.00
Percent of CPU this job got: 50%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.00
Average shared text size (kbytes): 0
…..etc
Conky Monitoring
Conky is application to show information usage some
service system, RAM, hardisk and information
download and upload our connection. As bellow
picture are showing information RAM use 96%.
Script clear memory
create file name clear.cache on text editor and copy
this script.
#!/bin/sh
sh -c "sync; echo 3 >
/proc/sys/vm/drop_caches"
give file access to the file using comman chmod +x
(file clear.cache)
root@bt:~# chmod + clear.cache
Result Clear Cache memory
Now we trying running script :
root@bt:~# ./cache
root@bt:~#
and then we can show usage memory back to down.
Conclusion/opinion
Every Linux OS has an efficient memory
management system used to clear the buffer cache periodically. You can manually free up the memory
cache with the following simple
references :
http://www.linux.com
http://www.linuxtoday.com/
http://www.conky.sourceforge.net/
http://stackoverflow.com

More Related Content

ODP
How to Diagnose Problems Quickly on Linux Servers
Richard Cunningham
 
ODP
LSA2 - 02 Control Groups
Marian Marinov
 
ODP
LSA2 - 02 Namespaces
Marian Marinov
 
PDF
Introducing NetBSD 5.0
Andrew Doran
 
PDF
LSA2 - PostgreSQL
Marian Marinov
 
PDF
RamDisk
Yashar Esmaildokht
 
PPTX
Backup, Restore, and Disaster Recovery
MongoDB
 
ODP
import rdma: zero-copy networking with RDMA and Python
groveronline
 
How to Diagnose Problems Quickly on Linux Servers
Richard Cunningham
 
LSA2 - 02 Control Groups
Marian Marinov
 
LSA2 - 02 Namespaces
Marian Marinov
 
Introducing NetBSD 5.0
Andrew Doran
 
LSA2 - PostgreSQL
Marian Marinov
 
Backup, Restore, and Disaster Recovery
MongoDB
 
import rdma: zero-copy networking with RDMA and Python
groveronline
 

What's hot (20)

PDF
Linux: Hardware Settings
John Ombagi
 
PDF
Summit demystifying systemd1
Susant Sahani
 
PDF
Systemd evolution revolution_regression
Susant Sahani
 
DOCX
System ctl file that is created at time of installation
AshishRanjan975320
 
PPTX
Installation of linux mint 18 sarah
Adich3
 
PPTX
Linux Kernel Init Process
Kernel TLV
 
PDF
SiteGround Tech TeamBuilding
Marian Marinov
 
PDF
Improve your storage with bcachefs
Marian Marinov
 
PDF
Linux booting procedure
Dhaval Kaneria
 
PPTX
Parallel computing in bioinformatics t.seemann - balti bioinformatics - wed...
Torsten Seemann
 
PDF
Configuring the boot menu in ubuntu
COMSATS
 
PDF
Linux boot process
Archana Chandrasekharan
 
DOCX
6 stages of linux boot process
Teja Bheemanapally
 
ODP
Linux monitoring
Mark Veltzer
 
PDF
Linux System Monitoring basic commands
Mohammad Rafiee
 
PPTX
Nvvp streams-3
Josh Wyatt
 
PPT
FreeNAS backup solution
a3
 
ODP
Memory management in Linux
Raghu Udiyar
 
PDF
Page reclaim
siburu
 
Linux: Hardware Settings
John Ombagi
 
Summit demystifying systemd1
Susant Sahani
 
Systemd evolution revolution_regression
Susant Sahani
 
System ctl file that is created at time of installation
AshishRanjan975320
 
Installation of linux mint 18 sarah
Adich3
 
Linux Kernel Init Process
Kernel TLV
 
SiteGround Tech TeamBuilding
Marian Marinov
 
Improve your storage with bcachefs
Marian Marinov
 
Linux booting procedure
Dhaval Kaneria
 
Parallel computing in bioinformatics t.seemann - balti bioinformatics - wed...
Torsten Seemann
 
Configuring the boot menu in ubuntu
COMSATS
 
Linux boot process
Archana Chandrasekharan
 
6 stages of linux boot process
Teja Bheemanapally
 
Linux monitoring
Mark Veltzer
 
Linux System Monitoring basic commands
Mohammad Rafiee
 
Nvvp streams-3
Josh Wyatt
 
FreeNAS backup solution
a3
 
Memory management in Linux
Raghu Udiyar
 
Page reclaim
siburu
 
Ad

Similar to Clear cache memory (20)

PPT
Linux memory consumption
haish
 
ODP
Where'd all my memory go? SCALE 12x SCALE12x
Joshua Miller
 
PDF
Understanding your memory usage under Linux
OpenFest team
 
PDF
Understanding your memory usage under Linux
Marian Marinov
 
PDF
Dev ops
Tom Hall
 
PDF
Help, my computer is sluggish
Kevin OBrien
 
PDF
Linux%20 memory%20management
Koteswaran Chandra Mohan
 
PDF
YOW2020 Linux Systems Performance
Brendan Gregg
 
PPTX
Refining Linux
Jason Murray
 
PDF
OSDC 2017 - Werner Fischer - Linux performance profiling and monitoring
NETWAYS
 
PDF
Broken Performance Tools
C4Media
 
PDF
Open Source Backup Cpnference 2014: Bareos in scientific environments, by Dr....
NETWAYS
 
PDF
LISA2019 Linux Systems Performance
Brendan Gregg
 
PDF
test
WentingLiu4
 
PPT
Servers and Processes: Behavior and Analysis
dreamwidth
 
PPTX
Linux memory-management-kamal
Kamal Maiti
 
PPT
16aug06.ppt
zagreb2
 
PDF
OSDC 2015: Georg Schönberger | Linux Performance Profiling and Monitoring
NETWAYS
 
PDF
Linux Performance Profiling and Monitoring
Georg Schönberger
 
PPTX
Debugging linux issues with eBPF
Ivan Babrou
 
Linux memory consumption
haish
 
Where'd all my memory go? SCALE 12x SCALE12x
Joshua Miller
 
Understanding your memory usage under Linux
OpenFest team
 
Understanding your memory usage under Linux
Marian Marinov
 
Dev ops
Tom Hall
 
Help, my computer is sluggish
Kevin OBrien
 
Linux%20 memory%20management
Koteswaran Chandra Mohan
 
YOW2020 Linux Systems Performance
Brendan Gregg
 
Refining Linux
Jason Murray
 
OSDC 2017 - Werner Fischer - Linux performance profiling and monitoring
NETWAYS
 
Broken Performance Tools
C4Media
 
Open Source Backup Cpnference 2014: Bareos in scientific environments, by Dr....
NETWAYS
 
LISA2019 Linux Systems Performance
Brendan Gregg
 
Servers and Processes: Behavior and Analysis
dreamwidth
 
Linux memory-management-kamal
Kamal Maiti
 
16aug06.ppt
zagreb2
 
OSDC 2015: Georg Schönberger | Linux Performance Profiling and Monitoring
NETWAYS
 
Linux Performance Profiling and Monitoring
Georg Schönberger
 
Debugging linux issues with eBPF
Ivan Babrou
 
Ad

Recently uploaded (20)

PDF
agentic-ai-and-the-future-of-autonomous-systems.pdf
siddharthnetsavvies
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
CIFDAQ's Token Spotlight: SKY - A Forgotten Giant's Comeback?
CIFDAQ
 
PDF
Software Development Company | KodekX
KodekX
 
PDF
Doc9.....................................
SofiaCollazos
 
PDF
DevOps & Developer Experience Summer BBQ
AUGNYC
 
PPT
L2 Rules of Netiquette in Empowerment technology
Archibal2
 
PDF
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
PDF
Chapter 2 Digital Image Fundamentals.pdf
Getnet Tigabie Askale -(GM)
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
Enable Enterprise-Ready Security on IBM i Systems.pdf
Precisely
 
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
PDF
Software Development Methodologies in 2025
KodekX
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PDF
CIFDAQ'S Market Insight: BTC to ETH money in motion
CIFDAQ
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
agentic-ai-and-the-future-of-autonomous-systems.pdf
siddharthnetsavvies
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
CIFDAQ's Token Spotlight: SKY - A Forgotten Giant's Comeback?
CIFDAQ
 
Software Development Company | KodekX
KodekX
 
Doc9.....................................
SofiaCollazos
 
DevOps & Developer Experience Summer BBQ
AUGNYC
 
L2 Rules of Netiquette in Empowerment technology
Archibal2
 
Event Presentation Google Cloud Next Extended 2025
minhtrietgect
 
Chapter 2 Digital Image Fundamentals.pdf
Getnet Tigabie Askale -(GM)
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
Enable Enterprise-Ready Security on IBM i Systems.pdf
Precisely
 
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
Software Development Methodologies in 2025
KodekX
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
CIFDAQ'S Market Insight: BTC to ETH money in motion
CIFDAQ
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 

Clear cache memory

  • 1. Clear Memory Cache on Ubuntu I'am use backtrack 5 R2 linux operating system, sometime my computer often find my memory full using process and services system. Here I will share trick to make efficient memory management system with clear memory, as like other article almost the same for the script using. My computer specification version detail as below : root@bt:/opt/nessus/sbin# lscpu Architecture: i686 CPU op-mode(s): 64-bit CPU(s): 2 Thread(s) per core: 1 Core(s) per socket: 2 CPU socket(s): 1 Vendor ID: AuthenticAMD CPU family: 20 Model: 2 Stepping: 0 CPU MHz: 780.000 Virtualization: AMD-V L1d cache: 32K L1i cache: 32K L2 cache: 512K And details using kernel Linux bt 2.6.39.4 / i686 GNU/Linux. Show Memory Process the computer has memory process are running on operating system, we can check using some command the following : counting total service on system : root@bt:service --status-all | wc -l [ ? ] vboxdrv [ ? ] vboxweb-service [ ? ] vmware-USBArbitrator [ ? ] wpa-ifupdown 27 And information details process memory using command top are result as below : top - 11:20:00 up 4:25, 6 users, load average: 0.26, 0.72, 0.81 Tasks: 177 total, 2 running, 173 sleeping, 0 stopped, 2 zombie Cpu(s): 31.3%us, 7.8%sy, 1.8%ni, 57.3%id, 1.3%wa, 0.0%hi, 0.5%si, 0.0%st Mem: 3612432k total, 3486996k used, 125436k free, 283264k buffers Swap: 2353516k total, 548k used, 2352968k free, 1547248k cached information peak memory usage : root@bt:/usr/bin/time -v ls / bin cdrom etc initrd.img lost+found mnt opt proc sbin share sys usr vmlinuz boot dev home lib media NONE pentest root selinux srv tmp var Command being timed: "ls /" User time (seconds): 0.00 System time (seconds): 0.00 Percent of CPU this job got: 50% Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.00 Average shared text size (kbytes): 0 …..etc
  • 2. Conky Monitoring Conky is application to show information usage some service system, RAM, hardisk and information download and upload our connection. As bellow picture are showing information RAM use 96%. Script clear memory create file name clear.cache on text editor and copy this script. #!/bin/sh sh -c "sync; echo 3 > /proc/sys/vm/drop_caches" give file access to the file using comman chmod +x (file clear.cache) root@bt:~# chmod + clear.cache Result Clear Cache memory Now we trying running script : root@bt:~# ./cache root@bt:~# and then we can show usage memory back to down. Conclusion/opinion Every Linux OS has an efficient memory management system used to clear the buffer cache periodically. You can manually free up the memory cache with the following simple references : http://www.linux.com http://www.linuxtoday.com/ http://www.conky.sourceforge.net/ http://stackoverflow.com