When installing fonts, the fonts cache will be created.
And its directory is "/var/cache/fontconfig"
2008年3月31日 星期一
Linux cache
因为LINUX的内核机制,一般情况下不需要特意去释放已经使用的cache。
这些cache起来的内容可以增加文件以及的读写速度。
先说下free命令怎么看内存
[root@yuyii proc]# free
total used free shared buffers cached
Mem: 515588 295452 220136 0 2060 64040
-/+ buffers/cache: 229352 286236
Swap: 682720 112 682608
其中第一行用全局角度描述系统使用的内存状况:
total——总物理内存
used——已使用内存,一般情况这个值会比较大,因为这个值包括了cache+应用程序使用的内存
free——完全未被使用的内存
shared——应用程序共享内存
buffers——缓存,主要用于目录方面,inode值等(ls大目录可看到这个值增加)
cached——缓存,用于已打开的文件
note:
total=used+free
used=buffers+cached (maybe add shared also)
第二行描述应用程序的内存使用:
前个值表示-buffers/cache——应用程序使用的内存大小,used减去缓存值
后个值表示+buffers/cache——所有可供应用程序使用的内存大小,free加上缓存值
note:
-buffers/cache=used-buffers-cached
+buffers/cache=free+buffers+cached
第三行表示swap的使用:
used——已使用
free——未使用
cache释放:
To free pagecache:
echo 1 > /proc/sys/vm/drop_caches
To free dentries and inodes:
echo 2 > /proc/sys/vm/drop_caches
To free pagecache, dentries and inodes:
echo 3 > /proc/sys/vm/drop_caches
说明,释放前最好sync一下,防止丢数据。
这些cache起来的内容可以增加文件以及的读写速度。
先说下free命令怎么看内存
[root@yuyii proc]# free
total used free shared buffers cached
Mem: 515588 295452 220136 0 2060 64040
-/+ buffers/cache: 229352 286236
Swap: 682720 112 682608
其中第一行用全局角度描述系统使用的内存状况:
total——总物理内存
used——已使用内存,一般情况这个值会比较大,因为这个值包括了cache+应用程序使用的内存
free——完全未被使用的内存
shared——应用程序共享内存
buffers——缓存,主要用于目录方面,inode值等(ls大目录可看到这个值增加)
cached——缓存,用于已打开的文件
note:
total=used+free
used=buffers+cached (maybe add shared also)
第二行描述应用程序的内存使用:
前个值表示-buffers/cache——应用程序使用的内存大小,used减去缓存值
后个值表示+buffers/cache——所有可供应用程序使用的内存大小,free加上缓存值
note:
-buffers/cache=used-buffers-cached
+buffers/cache=free+buffers+cached
第三行表示swap的使用:
used——已使用
free——未使用
cache释放:
To free pagecache:
echo 1 > /proc/sys/vm/drop_caches
To free dentries and inodes:
echo 2 > /proc/sys/vm/drop_caches
To free pagecache, dentries and inodes:
echo 3 > /proc/sys/vm/drop_caches
说明,释放前最好sync一下,防止丢数据。
If you mean the difference between the "cache" and "buff" columns in vmstat I believe the "cache" is file contents being cached in memory and "buff" is things like "inodes".
When writing a hugh file I see usage of both go up. When I use O_DIRECT, which is supposed to bypass the page cache, I only see "buff" go up".
Not being a Linux Guru I spent some quality grep time in the kernel source tree and tracked back what vmstat prints with data structure members in the kernel which seemed to comfirm that certain types of pages were cached in "buff" and the one type I believe I saw was inodes(or the equivalent thereof).
How to let firefox launch quickly
1 . load the related files into page caches
find /opt/firefox -type f -exec cat {} \; > /dev/null
2. find the related lib of executing firefox and create the output file of lib list.
ldd /opt/firefox/firefox-bin | grep -v "not found" | sed -e 's/.*=> //' -e 's/\s.*//' > ~/lib.txt
3. load the related lib into page caches
for i in `cat ~/lib.txt`; do (cat $i > /dev/null); done
find /opt/firefox -type f -exec cat {} \; > /dev/null
2. find the related lib of executing firefox and create the output file of lib list.
ldd /opt/firefox/firefox-bin | grep -v "not found" | sed -e 's/.*=> //' -e 's/\s.*//' > ~/lib.txt
3. load the related lib into page caches
for i in `cat ~/lib.txt`; do (cat $i > /dev/null); done
2008年3月27日 星期四
The booting process of Debian system
The booting in Debian is a two-stage process, involving the initial RAM filesystem (initramfs for short, sometimes it is also referred to as initrd, which stands for initial RAM disk). First, the bootloader loads the kernel and initramfs into memory, and passes the execution control to the kernel. After basic initialization the kernel extracts the initramfs archive and mounts it as a temporary root filesystem. initramfs contains kernel modules and userspace programs required to initialize the physical or logical device(s) containing the real root filesystem. The init script on the initramfs loads modules and performs other neccessary initialization steps. At the end of this stage run-init deletes the initramfs from memory, mounts the real root filesystem and passes control to the /sbin/init program on it.
Two major goals are achieved with such setup: the kernel size is kept under control by allowing most of the drivers to be compiled as modules (in a initramfs-less setup the drivers neccessary for the boot-time initialization of the root device must be compiled into it) and allow the setups which require initialization which cannot be done in-kernel, but is performed by userspace utilities.
Two major goals are achieved with such setup: the kernel size is kept under control by allowing most of the drivers to be compiled as modules (in a initramfs-less setup the drivers neccessary for the boot-time initialization of the root device must be compiled into it) and allow the setups which require initialization which cannot be done in-kernel, but is performed by userspace utilities.
2008年3月23日 星期日
footnotes for learning English 6
1. pop up 店家林立
ex: Self-service kiosks are popping up everywhere.
2.unveil 使公諸於眾 v.t.
ex: Alaska Airlines recently unveiled what it calls the Airport for the future.
3. zip through : to travel or move very quickly through something
ex:What we are trying to do is that separate the customers who have fairly simple transactions and can just zip through the standard check-in area.
4.new clips from around the world 世界新聞剪輯
5. departure 背離,出發,波段 (可數名詞)
ex:1. The new policy represents a complete departure from their previous position.
2. Because our eclipse tour was filling up so fast, we had to create a second departure.
6. charter 包租
ex: Sometimes an eclipse takes place in the ocean, and the only way to see it is to charter a ship.
7. skygazer 觀星族
8. eternity 永恆;(似乎)無終止的一段時間
ex:1. If we can get out of sea near Iwo Jima, we will see the 2009 eclipse even longer. That is an eternity to an eclipse junkie(成癮者).
9.I think we are much closer to the goal than people would have thought even two years ago. (我覺得我們比二年前人門所想像的更接近目標了). We will produce new imaging devices for humans in less than two years(在不滿二年內).
10.reach a lot of barriers遇到許多障礙
ex: We have reached a lot of barriers in the development of new drugs and new treatments for cancer that can not be overcome with current technologies.
11.breakthrough 突破(making an important discovery; a productive insight)
ex: The word "breakthrough" is often used when talking about the newest drug or the next treatment in cancer research.
12.get rid of something 清除某些東西
ex:The new ram based file system called "tmpfs" let us keep the files in the memory cache and never get rid of them until they're deleted or the system reboots.
13. aforementioned 如上述所提的
The aforementioned “Hello World” program is a perfect example.
When compiled, it can be loaded into memory and executed simply by typing
the name of the executable (hello) on the command line (assuming, of course, that
the executable exists somewhere on your PATH).
ex: Self-service kiosks are popping up everywhere.
2.unveil 使公諸於眾 v.t.
ex: Alaska Airlines recently unveiled what it calls the Airport for the future.
3. zip through : to travel or move very quickly through something
ex:What we are trying to do is that separate the customers who have fairly simple transactions and can just zip through the standard check-in area.
4.new clips from around the world 世界新聞剪輯
5. departure 背離,出發,波段 (可數名詞)
ex:1. The new policy represents a complete departure from their previous position.
2. Because our eclipse tour was filling up so fast, we had to create a second departure.
6. charter 包租
ex: Sometimes an eclipse takes place in the ocean, and the only way to see it is to charter a ship.
7. skygazer 觀星族
8. eternity 永恆;(似乎)無終止的一段時間
ex:1. If we can get out of sea near Iwo Jima, we will see the 2009 eclipse even longer. That is an eternity to an eclipse junkie(成癮者).
9.I think we are much closer to the goal than people would have thought even two years ago. (我覺得我們比二年前人門所想像的更接近目標了). We will produce new imaging devices for humans in less than two years(在不滿二年內).
10.reach a lot of barriers遇到許多障礙
ex: We have reached a lot of barriers in the development of new drugs and new treatments for cancer that can not be overcome with current technologies.
11.breakthrough 突破(making an important discovery; a productive insight)
ex: The word "breakthrough" is often used when talking about the newest drug or the next treatment in cancer research.
12.get rid of something 清除某些東西
ex:The new ram based file system called "tmpfs" let us keep the files in the memory cache and never get rid of them until they're deleted or the system reboots.
13. aforementioned 如上述所提的
The aforementioned “Hello World” program is a perfect example.
When compiled, it can be loaded into memory and executed simply by typing
the name of the executable (hello) on the command line (assuming, of course, that
the executable exists somewhere on your PATH).
2008年3月8日 星期六
footnotes for learning English 5
1. develop some sickness 患什麼病
ex: His father developed asthma(患氣喘病).
2. one be ... times the other one某一個東西是另一個東西的幾倍
ex:The earth is 49 times the size of the moon.
3.pour in 湧入 (to arrive continuously and in large mounts)
ex:Orders and appeals for new inventions have poured in from as far as Los Angeles, Istanbul and Dubai.
4.mecca 吸引人潮的地方,麥加
ex:India may be better known for its high-flying entrepreneurs who have turned the nation into a high-tech center and outsourcing mecca.
5. come up with 提出想法
ex: India's backyard inventors are coming up with creations that their backers hope will make it big, solve a few of the world's problems, boost India's exports, and continue cutting the country's dismal(令人沮喪的) poverty rate(貧困率).
6. whisk 快速且突然地帶走
ex:The solar-powered motorboat can whisk fishermen or eco-tourists silently and pollution-free(無污染地) through river backwaters.
7.alter someone to something警告某人某事發生
ex: To these inventors' credit, there is an ultra-efficient engine, and a low-cost alarm system designed to alert pedestrians to oncoming trains in foggy weather.
8 every time 每當
ex: There is even a mechanical speed bump that generate electricity every time a car passes.
ex: His father developed asthma(患氣喘病).
2. one be ... times the other one某一個東西是另一個東西的幾倍
ex:The earth is 49 times the size of the moon.
3.pour in 湧入 (to arrive continuously and in large mounts)
ex:Orders and appeals for new inventions have poured in from as far as Los Angeles, Istanbul and Dubai.
4.mecca 吸引人潮的地方,麥加
ex:India may be better known for its high-flying entrepreneurs who have turned the nation into a high-tech center and outsourcing mecca.
5. come up with 提出想法
ex: India's backyard inventors are coming up with creations that their backers hope will make it big, solve a few of the world's problems, boost India's exports, and continue cutting the country's dismal(令人沮喪的) poverty rate(貧困率).
6. whisk 快速且突然地帶走
ex:The solar-powered motorboat can whisk fishermen or eco-tourists silently and pollution-free(無污染地) through river backwaters.
7.alter someone to something警告某人某事發生
ex: To these inventors' credit, there is an ultra-efficient engine, and a low-cost alarm system designed to alert pedestrians to oncoming trains in foggy weather.
8 every time 每當
ex: There is even a mechanical speed bump that generate electricity every time a car passes.
訂閱:
文章 (Atom)