Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><code>free</code> won't show it as this is enforced via cgroups. Instead on the host (outside the container) you can check using <code>/sysfs</code> and the cgroup memory </p> <pre><code>vagrant@precise64:~$ docker run -m=524288 -d -t busybox sleep 3600 f03a017b174f vagrant@precise64:~$ cat /sys/fs/cgroup/memory/lxc/f03a017b174ff1022e0f46bc1b307658c2d96ffef1dd97e7c1929a4ca61ab80f//memory.limit_in_bytes 524288 </code></pre> <p>To see it run out of memory you can run something that will use more memory than you allocate - eg:</p> <pre><code>docker run -m=524288 -d -p 8000:8000 -t ubuntu:12.10 /usr/bin/python3 -m http.server 8480df1d2d5d vagrant@precise64:~$ docker ps | grep 0f742445f839 vagrant@precise64:~$ docker ps -a | grep 0f742445f839 0f742445f839 ubuntu:12.10 /usr/bin/python3 -m 16 seconds ago Exit 137 blue_pig </code></pre> <p>In <code>dmesg</code> you should see the container and process killed:</p> <pre><code>[ 583.447974] Pid: 1954, comm: python3 Tainted: GF O 3.8.0-33-generic #48~precise1-Ubuntu [ 583.447980] Call Trace: [ 583.447998] [&lt;ffffffff816df13a&gt;] dump_header+0x83/0xbb [ 583.448108] [&lt;ffffffff816df1c7&gt;] oom_kill_process.part.6+0x55/0x2cf [ 583.448124] [&lt;ffffffff81067265&gt;] ? has_ns_capability_noaudit+0x15/0x20 [ 583.448137] [&lt;ffffffff81191cc1&gt;] ? mem_cgroup_iter+0x1b1/0x200 [ 583.448150] [&lt;ffffffff8113893d&gt;] oom_kill_process+0x4d/0x50 [ 583.448171] [&lt;ffffffff816e1cf5&gt;] mem_cgroup_out_of_memory+0x1f6/0x241 [ 583.448187] [&lt;ffffffff816e1e7f&gt;] mem_cgroup_handle_oom+0x13f/0x24a [ 583.448200] [&lt;ffffffff8119000d&gt;] ? mem_cgroup_margin+0xad/0xb0 [ 583.448212] [&lt;ffffffff811949d0&gt;] ? mem_cgroup_charge_common+0xa0/0xa0 [ 583.448224] [&lt;ffffffff81193ff3&gt;] mem_cgroup_do_charge+0x143/0x170 [ 583.448236] [&lt;ffffffff81194125&gt;] __mem_cgroup_try_charge+0x105/0x350 [ 583.448249] [&lt;ffffffff81194987&gt;] mem_cgroup_charge_common+0x57/0xa0 [ 583.448261] [&lt;ffffffff8119517a&gt;] mem_cgroup_newpage_charge+0x2a/0x30 [ 583.448275] [&lt;ffffffff8115b4d3&gt;] do_anonymous_page.isra.35+0xa3/0x2f0 [ 583.448288] [&lt;ffffffff8115f759&gt;] handle_pte_fault+0x209/0x230 [ 583.448301] [&lt;ffffffff81160bb0&gt;] handle_mm_fault+0x2a0/0x3e0 [ 583.448320] [&lt;ffffffff816f844f&gt;] __do_page_fault+0x1af/0x560 [ 583.448341] [&lt;ffffffffa02b0a80&gt;] ? vfsub_read_u+0x30/0x40 [aufs] [ 583.448358] [&lt;ffffffffa02ba3a7&gt;] ? aufs_read+0x107/0x140 [aufs] [ 583.448371] [&lt;ffffffff8119bb50&gt;] ? vfs_read+0xb0/0x180 [ 583.448384] [&lt;ffffffff816f880e&gt;] do_page_fault+0xe/0x10 [ 583.448396] [&lt;ffffffff816f4bd8&gt;] page_fault+0x28/0x30 [ 583.448405] Task in /lxc/0f742445f8397ee7928c56bcd5c05ac29dcc6747c6d1c3bdda80d8e688fae949 killed as a result of limit of /lxc/0f742445f8397ee7928c56bcd5c05ac29dcc6747c6d1c3bdda80d8e688fae949 [ 583.448412] memory: usage 416kB, limit 512kB, failcnt 342 </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload