[lxc-devel] Resource cleanups

Dwight Engen dwight.engen at oracle.com
Mon Nov 26 17:17:40 UTC 2012


Hello,

Recently I wrote a lua binding for lxc on which I built a simple
lxc-top tool. In testing that my container class was properly freeing
all resources during garbage collection, I discovered that lxc itself
needs some cleanups. I will be posting a series of patches to do these
cleanups, which fix some memory/fd leaks for long(er) running processes
using the API. In addition I fixed some use after free errors and an
out-of-bounds error I found with valgrind.

In writing the binding, I found that some of the C API could easily be
const'ified (ie. the char *value in a lot of the config API), which
makes it easier to write a binding without having to strdup in the
binding. I think this also makes the API a bit cleaner. I'm going to
clean up these patches and submit them for consideration also.

I can post the lua binding, api test script, and top tool if there is
interest. Thanks.




More information about the lxc-devel mailing list