Package: lxc
Version: 1:1.0.6-6+deb8u2
Severity: normal

Dear Maintainer,

after configuring lxc, setting up a Debian Jessie container with openjdk
and Tomcat
I realised that lxc does not see the mem used by the java process:

Top in the host system says:
30017 mysql     20   0 13,453g 1,426g  29796 S   0,3  1,2   1:00.06 jav

Container top says:

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+
COMMAND
  381 tomcat7   20   0 13,453g 1,426g  29796 S   0,3  1,2   0:59.74 java

lxc-info output shows strange figures:

Name:           ct10
State:          RUNNING
PID:            29533
IP:             10.10.100.10
CPU use:        3.27 seconds
BlkIO use:      7.40 MiB
Memory use:     2.94 MiB
Link:           vethTNIID7
 TX bytes:      30.50 KiB
 RX bytes:      55.98 KiB
 Total bytes:   86.47 KiB

Setting the limits works by the way, but not for the Java/Tomcat process,
as it is not seen:

lxc.cgroup.memory.limit_in_bytes = 512M
lxc.cgroup.memory.memsw.limit_in_bytes = 512M

When I start filling up the memory with stress, the process is recognized
by lxc and gets killed as it should be:

[Mi Jan 13 16:38:06 2016] Task in /lxc/ct10 killed as a result of limit of
/lxc/ct10
[Mi Jan 13 16:38:06 2016] memory: usage 524288kB, limit 524288kB, failcnt
981
[Mi Jan 13 16:38:06 2016] memory+swap: usage 524288kB, limit 524288kB,
failcnt 0
[Mi Jan 13 16:38:06 2016] kmem: usage 0kB, limit 18014398509481983kB,
failcnt 0
[Mi Jan 13 16:38:06 2016] Memory cgroup stats for /lxc/ct10: cache:124KB
rss:524164KB rss_huge:0KB mapped_file:20KB writeback:0KB swap:0KB
inactive_anon:66344KB active_anon:457904KB inactive_file:8KB
active_file:0KB unevictable:0KB
[Mi Jan 13 16:38:06 2016] [ pid ]   uid  tgid total_vm      rss nr_ptes
swapents oom_score_adj name
[Mi Jan 13 16:38:06 2016] [31700]     0 31700     6599      507
18        0             0 bash
[Mi Jan 13 16:38:06 2016] [31783]     0 31783     1792       21
6        0             0 stress
[Mi Jan 13 16:38:06 2016] [31784]     0 31784 27116072   130571
262        0             0 stress
[Mi Jan 13 16:38:06 2016] Memory cgroup out of memory: Kill process 31784
(stress) score 968 or sacrifice child
[Mi Jan 13 16:38:06 2016] Killed process 31784 (stress)
total-vm:108464288kB, anon-rss:522200kB, file-rss:84kB



-- System Information:
Debian Release: 8.2
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/24 CPU cores)
Locale: LANG=de_DE@euro, LC_CTYPE=de_DE@euro (charmap=ISO-8859-15)
Shell: /bin/sh linked to /bin/bash
Init: systemd (via /run/systemd/system)

Versions of packages lxc depends on:
ii  init-system-helpers  1.22
ii  libapparmor1         2.9.0-3
ii  libc6                2.19-18+deb8u1
ii  libcap2              1:2.24-8
ii  libseccomp2          2.1.1-1
ii  libselinux1          2.3-2
ii  multiarch-support    2.19-18+deb8u1
ii  python3              3.4.2-2

Versions of packages lxc recommends:
ii  debootstrap  1.0.67
ii  openssl      1.0.1k-3+deb8u2
ii  rsync        3.1.1-3

Versions of packages lxc suggests:
pn  lua5.2  <none>

-- no debconf information

Thanks for the help and ideas.

Nemanja

Reply via email to