3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Docker で OOM の再現方法

Posted at

メモです。

以下のコンテナを使いつつ、docker run の際に -m オプションでメモリのハードリミットを指定すると簡単に再現出来る。

polinux/stress

# メモリの負荷を掛けるように起動
$docker run -m "10m" -d polinux/stress stress --vm-bytes 128M --vm 1
a6386b5adc9b444a0abc83fe747f444a41cd8372409140187b158e740dfb3e4a

# すぐに終了している
$docker ps -a |grep a6386b5ad
a6386b5adc9b   polinux/stress                   "stress --vm-bytes 1…"   3 minutes ago    Exited (1) 3 minutes ago             strange_kalam

# OOM により kill されたことが分かる
$docker inspect a6386b5ad |grep OOM
            "OOMKilled": true,
3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?