While running valgrind I noticed two spots with memory not being free'd,
but having fairly small impact.
In pvfs2-server.c an array for holding BMI addresses of metadata servers
gets leaked on precreate pool initialization for each filesystem.
In dbpf-attr-cache.c the data buffer in the keyval pairs for each cache
elements isn't free'd on finalize.
Patch against head included for review. I did limited testing and didn't
see any immediate problems.
Michael
diff -ur head-a/pvfs2/src/io/trove/trove-dbpf/dbpf-attr-cache.c
head-b/pvfs2/src/io/trove/trove-dbpf/dbpf-attr-cache.c
--- head-a/pvfs2/src/io/trove/trove-dbpf/dbpf-attr-cache.c 2008-11-11
14:25:57.000000000 -0500
+++ head-b/pvfs2/src/io/trove/trove-dbpf/dbpf-attr-cache.c 2009-10-28
12:53:32.000000000 -0400
@@ -140,7 +140,7 @@
int dbpf_attr_cache_finalize(void)
{
- int ret = -1, i = 0;
+ int ret = -1, i = 0, j = 0;
struct qlist_head *hash_link = NULL;
dbpf_attr_cache_elem_t *cache_elem = NULL;
@@ -156,6 +156,13 @@
{
cache_elem = qhash_entry(
hash_link, dbpf_attr_cache_elem_t, hash_link);
+ for( j = 0; j < cache_elem->num_keyval_pairs; j++ )
+ {
+ /* any elements still existing need their keyval pairs
+ * data pointer free'd before the element is free'd */
+ if( cache_elem->keyval_pairs[j].data )
+ free(cache_elem->keyval_pairs[j].data);
+ }
free(cache_elem);
s_current_num_cache_elems--;
}
diff -ur head-a/pvfs2/src/server/pvfs2-server.c
head-b/pvfs2/src/server/pvfs2-server.c
--- head-a/pvfs2/src/server/pvfs2-server.c 2009-09-02 17:10:42.000000000
-0400
+++ head-b/pvfs2/src/server/pvfs2-server.c 2009-10-28 12:50:40.000000000
-0400
@@ -2354,6 +2354,7 @@
job_precreate_pool_set_index(server_index);
cur_f = PINT_llist_next(cur_f);
+ free(addr_array); // local variable, malloc'd above to get BMI addrs
}
_______________________________________________
Pvfs2-developers mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers