Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Linuxのメモリ管理入門
Search
Satoru Takeuchi
PRO
September 17, 2022
Technology
1
380
Linuxのメモリ管理入門
以下動画のテキストです。
https://youtu.be/ncHq6xgLkZs
Satoru Takeuchi
PRO
September 17, 2022
Tweet
Share
More Decks by Satoru Takeuchi
See All by Satoru Takeuchi
「Linux」という言葉が指すもの
sat
PRO
3
84
APIとABIの違い
sat
PRO
5
62
ファイルシステムへのアクセス方法
sat
PRO
0
26
ファイルシステム
sat
PRO
1
32
低レイヤソフトウェア技術者が YouTuberとして食っていこうとした話
sat
PRO
7
6.1k
ポーリングと割り込み
sat
PRO
1
80
Rook: Intro and Deep Dive With Ceph
sat
PRO
1
140
会社員しながら本を書いてきた知見の共有
sat
PRO
3
880
デバイスにアクセスするデバイスファイル
sat
PRO
1
62
Other Decks in Technology
See All in Technology
生成AIでセキュリティ運用を効率化する話
sakaitakeshi
0
570
JTCにおける内製×スクラム開発への挑戦〜内製化率95%達成の舞台裏/JTC's challenge of in-house development with Scrum
aeonpeople
0
200
今!ソフトウェアエンジニアがハードウェアに手を出すには
mackee
11
4.6k
Snowflakeの生成AI機能を活用したデータ分析アプリの作成 〜Cortex AnalystとCortex Searchの活用とStreamlitアプリでの利用〜
nayuts
1
470
エラーとアクセシビリティ
schktjm
1
1.2k
Function Body Macros で、SwiftUI の View に Accessibility Identifier を自動付与する/Function Body Macros: Autogenerate accessibility identifiers for SwiftUI Views
miichan
2
180
5分でカオスエンジニアリングを分かった気になろう
pandayumi
0
220
バイブスに「型」を!Kent Beckに学ぶ、AI時代のテスト駆動開発
amixedcolor
2
530
ZOZOマッチのアーキテクチャと技術構成
zozotech
PRO
3
1.5k
Django's GeneratedField by example - DjangoCon US 2025
pauloxnet
0
120
2025年になってもまだMySQLが好き
yoku0825
8
4.7k
EncryptedSharedPreferences が deprecated になっちゃった!どうしよう! / Oh no! EncryptedSharedPreferences has been deprecated! What should I do?
yanzm
0
220
Featured
See All Featured
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.1k
Making Projects Easy
brettharned
117
6.4k
Thoughts on Productivity
jonyablonski
70
4.8k
Being A Developer After 40
akosma
90
590k
The Cost Of JavaScript in 2023
addyosmani
53
8.9k
Why Our Code Smells
bkeepers
PRO
339
57k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
18
1.1k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
34
6k
jQuery: Nuts, Bolts and Bling
dougneiner
64
7.9k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Imperfection Machines: The Place of Print at Facebook
scottboms
268
13k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
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を見よう