1

I am running dbench benchmarking tool for fileio on my fuse filesystem implementation and I am making sure that that fuse can sustain the test.

I am use libfuse library (https://github.com/libfuse/libfuse) to implement fuse. I am not doing anything fancy, I am just made it a pass through, reads just do pread and writes just do pwrite.

I left it running for about 10 hours and I see a steady increase in memory from 0 to 21G. Has anyone else seen this? I checked for mem leaks in my code but I am doing really simple passthrough code that I no where allocate heap memory specifically. Like a simple read function looks like this. FUSE_DATA is a global struct that gets assigned in the main function.

void fuse_fullpath(char fpath[PATH_MAX], const char *path, const char * rootdir)
{
    if (rootdir == NULL || path == NULL) {
        return;
    }
    strcpy(fpath, rootdir);
    strncat(fpath, path, PATH_MAX);
}

static int fuse_read(const char *path, char *buf, size_t size, off_t offset,
        struct fuse_file_info *fi)
{
    int res;
    char fpath[PATH_MAX];
    fuse_fullpath(fpath, path, FUSE_DATA->rootdir);

    res = pread(fi->fh, buf, size, offset);

   if (res == -1) {
       res = -errno;
   }

   return res;

}

I tried valgrind on fuse and the report from it just gives me a lot in libgobject library like this.

==31923== 8 bytes in 1 blocks are still reachable in loss record 2 of 245
==31923==    at 0x4C2CC70: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==31923==    by 0x54E0668: g_malloc0 (in /lib/x86_64-linux-gnu/libglib-2.0.so.0.4002.0)
==31923==    by 0x4E63315: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4002.0)
==31923==    by 0x4E67108: g_type_register_static (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4002.0)
==31923==    by 0x4E6FF71: g_pointer_type_register_static (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4002.0)
==31923==    by 0x4E6FFF7: g_gtype_get_type (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4002.0)
==31923==    by 0x4E558E7: ??? (in /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0.4002.0)
Aila
  • 319
  • 1
  • 4
  • 11
  • I don't think we have enough info to help you. Can you narrow in on [minimal, complete, and verifiable example](http://stackoverflow.com/help/mcve)? – Brian McFarland Nov 15 '16 at 16:46
  • Some questions that cross my mind here: Are you repeatedly doing open/read/write/close operations? Or just leaving a file open for long periods of time and reading / writing? Also.... why do you suspect fuse to be the problem when valgrind complains about libgobject stuff? – Brian McFarland Nov 15 '16 at 16:48

0 Answers0