[lkml]   [2005]   [Oct]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [BUG][] Memoryleak - idr_layer_cache slab - inotify?
    Stefan Jones wrote:

    > I noticed this a while back when gam_server (new fam replacement)
    > started playing up and the idr_layer_cache slab used up 300Mb of RAM.
    > To reproduce:
    > Run gnome and make sure it is using gam_server for fam.
    > In one console do:
    > while true ;do sleep 0.1 ; killall -w gam_server; done
    > In another try slabtop and see the idr_layer_cache slab climb, eating
    > memory (abit slowly).
    > ( Gnome restarts gam_server after each kill for you and gets it doing
    > stuff )
    > I looked though the source and inotify does use the idr_layer_cache slab
    > and gam_server also uses inotify.

    Made a standalone testcase, run this and the kernel will eat up your
    memory (seen via slabtop):

    ( this should compile everywhere )

    #include <sys/wait.h>
    #include <signal.h>
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <fcntl.h>
    #include <unistd.h>
    #include <sys/select.h>
    #include <asm/unistd.h>
    #include <errno.h>

    #define __NR_inotify_init 291
    #define __NR_inotify_add_watch 292
    #define __NR_inotify_rm_watch 293

    _syscall0(int, inotify_init);
    _syscall3(int, inotify_add_watch, int, fd, const char *, name, unsigned
    int, mask);
    _syscall2(int, inotify_rm_watch, int, fd, unsigned int, wd);

    int main() {
    pid_t pid;
    int fd;
    int wd;
    const char *dirname=".";
    unsigned int mask = 0xffffffff;
    int stat;

    for(;;) {
    if(!(pid = fork())) {
    fd = inotify_init ();

    wd = inotify_add_watch (fd, dirname, mask);
    if (wd < 0)
    perror ("inotify_add_watch");


    return 0;
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-10-21 20:56    [W:0.022 / U:15.368 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site