OpenVZ Forum


Home » General » Support » vps memory leak
vps memory leak [message #2681] Sun, 16 April 2006 10:13
grummund is currently offline  grummund
Messages: 1
Registered: April 2006
Junior Member
Hi,

Could someone tell me if this problem is due to a bug in openvz or a possible configuration error?

I have been allocated 64MB RAM on this vps, which should be enough for my needs but it seems all too easy to stuff the system and end up with a permanent "fork: Cannot allocate memory" errors.

What raises suspicions is this from bean_counters:
uid  resource           held    maxheld    barrier      limit    failcnt
     privvmpages       14192      19309      16384      16384        723

how can maxheld be greater than barrier??

Pasted below are the full actions to cause this, the above snippet is from the last cat of bean_counters.

I have also raised a report for this in bugzilla:
http://bugzilla.openvz.org/show_bug.cgi?id=141

foobar:~# ls /
bin   dev  home    lib    mnt  proc  sbin  swapfile  tmp  var
boot  etc  initrd  media  opt  root  srv   sys       usr
foobar:~# ls -l /
total 130268
drwxr-xr-x    2 root root       4096 Apr 11 08:21 bin
drwxr-xr-x    2 root root       4096 Dec 15  2004 boot
drwxr-xr-x   11 root root      24576 Apr 15 23:35 dev
drwxr-xr-x   35 root root       4096 Apr 15 23:35 etc
drwxrwsr-x    3 root staff      4096 Apr 15 11:26 home
drwxr-xr-x    2 root root       4096 Dec 20 11:44 initrd
drwxr-xr-x    6 root root       4096 Apr 15 11:18 lib
drwxr-xr-x    2 root root       4096 Dec 20 11:44 media
drwxr-xr-x    2 root root       4096 Dec 15  2004 mnt
drwxr-xr-x    2 root root       4096 Dec 20 11:44 opt
dr-xr-xr-x  339 root root          0 Apr 15 23:35 proc
drwx------    3 root root       4096 Apr 15 21:50 root
drwxr-xr-x    2 root root       4096 Apr 11 08:21 sbin
drwxr-xr-x    2 root root       4096 Dec 20 11:44 srv
-rw-r--r--    1 root root  133169152 Apr 15 23:23 swapfile
drwxr-xr-x    2 root root       4096 May 10  2005 sys
drwxrwxrwt    2 root root       4096 Apr 16 00:28 tmp
drwxr-xr-x   11 root root       4096 Dec 20 11:44 usr
drwxr-xr-x   13 root root       4096 Dec 20 11:44 var
foobar:~# df -h
Filesystem            Size  Used Avail Use% Mounted on
simfs                 350M  304M   47M  87% /
tmpfs                 443M     0  443M   0% /dev/shm
foobar:~# ls -hl /
total 128M
drwxr-xr-x    2 root root  4.0K Apr 11 08:21 bin
drwxr-xr-x    2 root root  4.0K Dec 15  2004 boot
drwxr-xr-x   11 root root   24K Apr 15 23:35 dev
drwxr-xr-x   35 root root  4.0K Apr 15 23:35 etc
drwxrwsr-x    3 root staff 4.0K Apr 15 11:26 home
drwxr-xr-x    2 root root  4.0K Dec 20 11:44 initrd
drwxr-xr-x    6 root root  4.0K Apr 15 11:18 lib
drwxr-xr-x    2 root root  4.0K Dec 20 11:44 media
drwxr-xr-x    2 root root  4.0K Dec 15  2004 mnt
drwxr-xr-x    2 root root  4.0K Dec 20 11:44 opt
dr-xr-xr-x  339 root root     0 Apr 15 23:35 proc
drwx------    3 root root  4.0K Apr 15 21:50 root
drwxr-xr-x    2 root root  4.0K Apr 11 08:21 sbin
drwxr-xr-x    2 root root  4.0K Dec 20 11:44 srv
-rw-r--r--    1 root root  127M Apr 15 23:23 swapfile
drwxr-xr-x    2 root root  4.0K May 10  2005 sys
drwxrwxrwt    2 root root  4.0K Apr 16 00:28 tmp
drwxr-xr-x   11 root root  4.0K Dec 20 11:44 usr
drwxr-xr-x   13 root root  4.0K Dec 20 11:44 var
foobar:~# rm /swapfile
foobar:~# cat /proc/user_beancounters
Version: 2.5
       uid  resource           held    maxheld    barrier      limit    failcnt
       207: kmemsize         641716     685388   33554432   67108864          0
            lockedpages           0          0          4          4          0
            privvmpages       11109      16206      16384      16384        100
            shmpages            960        976       1152       1152          2
            dummy                 0          0          0          0          0
            numproc              13         15         60         60          0
            physpages          1197       1237          0 2147483647          0
            vmguarpages           0          0       1725 2147483647          0
            oomguarpages       1197       1237       1725 2147483647          0
            numtcpsock            3          3         10         10          0
            numflock              2          4         50        100          0
            numpty                2          2         10         10          0
            numsiginfo            0          2        256        256          0
            tcpsndbuf          6660      13320    1048576    1048576          0
            tcprcvbuf             0       2220    1048576    1048576          0
            othersockbuf       2220       6408      65536     102400          0
            dgramrcvbuf           0       1196      65536     102400          0
            numothersock          7         10         10         10          0
            dcachesize        52530      56135      99000      99000          0
            numfile             141        160        800       1000          0
            dummy                 0          0          0          0          0
            dummy                 0          0          0          0          0
            dummy                 0          0          0          0          0
            numiptent             4          4         50         50          0
foobar:~# cat /proc/user_beancounters
Version: 2.5
       uid  resource           held    maxheld    barrier      limit    failcnt
       207: kmemsize         641460     685388   33554432   67108864          0
            lockedpages           0          0          4          4          0
            privvmpages       11109      16227      16384      16384        436
            shmpages            960        976       1152       1152          2
            dummy                 0          0          0          0          0
            numproc              13         15         60         60          0
            physpages          1198       1237          0 2147483647          0
            vmguarpages           0          0       1725 2147483647          0
            oomguarpages       1198       1237       1725 2147483647          0
            numtcpsock            3          3         10         10          0
            numflock              2          4         50        100          0
            numpty                2          2         10         10          0
            numsiginfo            0          2        256        256          0
            tcpsndbuf          6660      13320    1048576    1048576          0
            tcprcvbuf             0       2220    1048576    1048576          0
            othersockbuf       2220       6408      65536     102400          0
            dgramrcvbuf           0       1196      65536     102400          0
            numothersock          7         10         10         10          0
            dcachesize        52530      56135      99000      99000          0
            numfile             141        160        800       1000          0
            dummy                 0          0          0          0          0
            dummy                 0          0          0          0          0
            dummy                 0          0          0          0          0
            numiptent             4          4         50         50          0
foobar:~# ps
  PID TTY          TIME CMD
 8017 pts/1    00:00:00 bash
 9488 pts/1    00:00:00 ps
foobar:~# dd if=/dev/zero of=/swapfile bs=1M count=32
32+0 records in
32+0 records out
33554432 bytes transferred in 0.562373 seconds (59665788 bytes/sec)
foobar:~# ps
-su: fork: Cannot allocate memory

## NOTE: at this point I logged out from an idle shell to free
## up some memory.  Then at least I can investigate whats up.

foobar:~# ps
  PID TTY          TIME CMD
 8017 pts/1    00:00:00 bash
 9966 pts/1    00:00:00 ps
foobar:~# ps aux
USER       PID %CPU %MEM   VSZ  RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0  1584  520 ?        Ss   Apr15   0:00 ini
root     20131  0.0  0.0  1628  540 ?        Ss   Apr15   0:00 /sbin/syslogd
root     20139  0.0  0.1  3544  928 ?        Ss   Apr15   0:00 /usr/sbin/sshd
daemon   20142  0.0  0.0  1764  364 ?        Ss   Apr15   0:00 /usr/sbin/atd
root     20145  0.0  0.0  1820  640 ?        Ss   Apr15   0:00 /usr/sbin/cron
root      8002  0.0  0.1 14516 1784 ?        Ss   08:37   0:00 sshd: bb [priv]
bb        8005  0.0  0.1 14516 1372 ?        R    08:37   0:00 sshd: bb@pts/1
bb        8006  0.0  0.1  2620 1424 pts/1    Ss   08:37   0:00 -bash
root      8017  0.0  0.1  2640 1460 pts/1    S    08:37   0:00 -su
root     10124  0.0  0.0  2564  848 pts/1    R+   08:49   0:00 ps aux
foobar:~# ps alx
F   UID   PID  PPID PRI  NI   VSZ  RSS WCHAN  STAT TTY        TIME COMMAND
4     0     1     0  16   0  1584  520 -      Ss   ?          0:00 ini
1     0 20131     1  16   0  1628  540 -      Ss   ?          0:00 /sbin/syslogd
5     0 20139     1  16   0  3544  928 -      Ss   ?          0:00 /usr/sbin/sshd
1     1 20142     1  16   0  1764  364 -      Ss   ?          0:00 /usr/sbin/atd
1     0 20145     1  16   0  1820  640 -      Ss   ?          0:00 /usr/sbin/cron
5     0  8002 20139  15   0 14516 1784 -      Ss   ?          0:00 sshd: bb [priv]
5  1000  8005  8002  17   0 14516 1372 -      R    ?          0:00 sshd: bb@pts/1
0  1000  8006  8005  15   0  2620 1424 wait   Ss   pts/1      0:00 -bash
4     0  8017  8006  16   0  2640 1460 -      R    pts/1      0:00 -su
4     0 10205  8017  16   0  2376  684 -      R+   pts/1      0:00 ps alx
foobar:~# cat /proc/user_beancounters
Version: 2.5
       uid  resource           held    maxheld    barrier      limit    failcnt
       207: kmemsize         495267     685388   33554432   67108864          0
            lockedpages           0          0          4          4          0
            privvmpages       14189      19309      16384      16384        615
    
...

[Updated on: Mon, 17 April 2006 08:00]

Report message to a moderator

 
Read Message
Previous Topic: Is NFS virtualized fully?
Next Topic: LVM problem - CentOS 4.3 x86 - openvz 2.6.8-022stab072-smp
Goto Forum:
  


Current Time: Thu Jul 11 03:23:36 GMT 2024

Total time taken to generate the page: 0.02499 seconds