$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Linuxのメモリ管理入門
Search
Satoru Takeuchi
PRO
September 17, 2022
Technology
1
390
Linuxのメモリ管理入門
以下動画のテキストです。
https://youtu.be/ncHq6xgLkZs
Satoru Takeuchi
PRO
September 17, 2022
Tweet
Share
More Decks by Satoru Takeuchi
See All by Satoru Takeuchi
eBPF
sat
PRO
1
96
waruiBPF
sat
PRO
0
91
eBPFとwaruiBPF
sat
PRO
4
2.7k
Pythonのコードの気になる行でスタックトレースを出す
sat
PRO
0
89
ソースコードを読むときの思考プロセスの例 ~markdownのレンダリング方法を知りたかった2 markdownパッケージ~
sat
PRO
0
180
様々なファイルシステム
sat
PRO
0
320
ソースを読む時の思考プロセスの例-MkDocs
sat
PRO
1
410
ソースを読むプロセスの例
sat
PRO
22
17k
メモリマップトファイル
sat
PRO
1
170
Other Decks in Technology
See All in Technology
Lookerで実現するセキュアな外部データ提供
zozotech
PRO
0
200
AWSの新機能をフル活用した「re:Inventエージェント」開発秘話
minorun365
2
400
Connection-based OAuthから学ぶOAuth for AI Agents
flatt_security
0
320
通勤手当申請チェックエージェント開発のリアル
whisaiyo
3
380
ActiveJobUpdates
igaiga
1
300
[Data & AI Summit '25 Fall] AIでデータ活用を進化させる!Google Cloudで作るデータ活用の未来
kirimaru
0
2.4k
たまに起きる外部サービスの障害に備えたり備えなかったりする話
egmc
0
390
20251222_next_js_cache__1_.pdf
sutetotanuki
0
170
障害対応訓練、その前に
coconala_engineer
0
180
ソフトウェアエンジニアとAIエンジニアの役割分担についてのある事例
kworkdev
PRO
0
150
AWSインフルエンサーへの道 / load of AWS Influencer
whisaiyo
0
200
【開発を止めるな】機能追加と並行して進めるアーキテクチャ改善/Keep Shipping: Architecture Improvements Without Pausing Dev
bitkey
PRO
1
120
Featured
See All Featured
Reflections from 52 weeks, 52 projects
jeffersonlam
355
21k
Accessibility Awareness
sabderemane
0
23
A better future with KSS
kneath
240
18k
SEO for Brand Visibility & Recognition
aleyda
0
4.1k
Everyday Curiosity
cassininazir
0
110
Automating Front-end Workflow
addyosmani
1371
200k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
How STYLIGHT went responsive
nonsquared
100
6k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
25
A Tale of Four Properties
chriscoyier
162
23k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
120
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
1
260
Transcript
Linuxのメモリ管理入門 Sep. 17th, 2022 Satoru Takeuchi twitter: satoru_takeuchi
マシンの物理メモリはカーネル&全プロセス共有 マシンの全メモリ 空きメモリ プロセス0 のメモリ プロセス1 のメモリ カーネルのメモリ プロセスn のメモリ
… 物理メモリを管理して各プロセスにメモリを割り当てる
freeコマンドでうちわけがわかる total プロセスが使用中 free カーネルが使用中 解放可能 解放不可能 buff/cache (バッファキャッシュ& ページキャッシュ)
used = total - free - buff/cache available
大事なところだけ抜粋 total プロセスが使用中 free カーネルが使用中 解放可能 解放不可能 available
空きメモリが減ってくると… total プロセスが使用中 free カーネルが使用中 解放可能 解放不可能 available せまくてつらい
カーネルの解放可能メモリを解放 total プロセスが使用中 free カーネルが使用中 解放不可能 available つらくなくなった 解放可能
📝 メモリ使用量についてもっと細かく知りたければ • /proc/meminfoにメモリ使用量のさらに詳しいうちわけがわかる • カーネルの知識がないと理解が大変 • 興味があればman procfsの説明を見てね
まとめ 物理メモリはカーネルが管理し、カーネルとプロセスが共用 freeコマンドを使えば物理メモリ使用量のだいたいの内訳がわかる メモリが減ってきたら解放可能メモリを解放する freeフィールドに騙されずにavailableフィールドを見よう もっと知りたければ/proc/meminfoを見よう