<div dir="ltr"><span style="font-size:12.8px">Hello,</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">I checked the memory consuming of the multipathd and found it consumes too much memory.</span><br style="font-size:12.8px"><span style="font-size:12.8px">Following is the result I have got from 6 servers.</span><br style="font-size:12.8px"><span style="font-size:12.8px">Longer running multipathd consumes more memory.</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px"># ps -eo user,pid,ppid,rss,size,vsize,p</span><span style="font-size:12.8px">mem,pcpu,time,cmd --sort -rss | grep multipath</span><br style="font-size:12.8px"><span style="font-size:12.8px">root      2948     1  4376 66764  98572  0.0  0.0 00:00:01 /sbin/multipathd</span><br style="font-size:12.8px"><span style="font-size:12.8px">root      3035     1  8648 71068 102876  0.0  0.1 00:09:11 /sbin/multipathd</span><br style="font-size:12.8px"><span style="font-size:12.8px">root     39004     1 10236 137944 169752  0.0 0.1 03:20:43 /sbin/multipathd</span><br style="font-size:12.8px"><span style="font-size:12.8px">root      3149     1 11976 139792 171600  0.0 0.2 05:37:37 /sbin/multipathd</span><br style="font-size:12.8px"><span style="font-size:12.8px">root      3168     1 13792 76056 107864  0.0  0.3 07:04:41 /sbin/multipathd</span><br style="font-size:12.8px"><span style="font-size:12.8px">root      3135     1 14920 142500 174308  0.0 0.4 08:49:38 /sbin/multipathd</span><br style="font-size:12.8px"><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">So I did valgrind test with debian 0.4.9 version and I've got following error.</span><br style="font-size:12.8px"><span style="font-size:12.8px">pp->getuid is initialized by malloc but it is not freed.</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">==14958== 280 bytes in 4 blocks are definitely lost in loss record 2 of 3</span><br style="font-size:12.8px"><span style="font-size:12.8px">==14958==    at 0x4C28C20: malloc (vg_replace_malloc.c:296)</span><br style="font-size:12.8px"><span style="font-size:12.8px">==14958==    by 0x5702D2E: select_getuid (in /lib/libmultipath.so.0)</span><br style="font-size:12.8px"><span style="font-size:12.8px">==14958==    by 0x56FFA0F: ??? (in /lib/libmultipath.so.0)</span><br style="font-size:12.8px"><span style="font-size:12.8px">==14958==    by 0x5701707: pathinfo (in /lib/libmultipath.so.0)</span><br style="font-size:12.8px"><span style="font-size:12.8px">==14958==    by 0x5701BDE: store_pathinfo (in /lib/libmultipath.so.0)</span><br style="font-size:12.8px"><span style="font-size:12.8px">==14958==    by 0x5701F17: path_discovery (in /lib/libmultipath.so.0)</span><br style="font-size:12.8px"><span style="font-size:12.8px">==14958==    by 0x407916: configure (main.c:1310)</span><br style="font-size:12.8px"><span style="font-size:12.8px">==14958==    by 0x404B60: child (main.c:1623)</span><br style="font-size:12.8px"><span style="font-size:12.8px">==14958==    by 0x404B60: main (main.c:1834)</span><br style="font-size:12.8px"><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">Finally I've applied following patch.</span><br style="font-size:12.8px"><span style="font-size:12.8px">The valgrind does not complain any more.</span><br style="font-size:12.8px"><span style="font-size:12.8px">I checked the latest source but orphan_path() has no patch like that.</span><br style="font-size:12.8px"><span style="font-size:12.8px">I'd appreciate if you would review my patch and give me any feedback.</span><br style="font-size:12.8px"><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">------------------------- 8< ------------------</span><br style="font-size:12.8px"><span style="font-size:12.8px">diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c</span><br style="font-size:12.8px"><span style="font-size:12.8px">index 6d2d45e..007b5eb 100644</span><br style="font-size:12.8px"><span style="font-size:12.8px">--- a/libmultipath/structs_vec.c</span><br style="font-size:12.8px"><span style="font-size:12.8px">+++ b/libmultipath/structs_vec.c</span><br style="font-size:12.8px"><span style="font-size:12.8px">@@ -84,6 +84,8 @@ orphan_path (struct path * pp, const char *reason)</span><br style="font-size:12.8px"><span style="font-size:12.8px">        pp->mpp = NULL;</span><br style="font-size:12.8px"><span style="font-size:12.8px">        pp->dmstate = PSTATE_UNDEF;</span><br style="font-size:12.8px"><span style="font-size:12.8px">        pp->uid_attribute = NULL;</span><br style="font-size:12.8px"><span style="font-size:12.8px">+    if (pp->getuid)</span><br style="font-size:12.8px"><span style="font-size:12.8px">+        free(pp->getuid);</span><br style="font-size:12.8px"><span style="font-size:12.8px">        pp->getuid = NULL;</span><br style="font-size:12.8px"><span style="font-size:12.8px">        prio_put(&pp->prio);</span><br style="font-size:12.8px"><span style="font-size:12.8px">        checker_put(&pp->checker);</span><br>
</div>