<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:clearspace="http://www.jivesoftware.com/xmlns/clearspace/rss" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>VMware Communities: Message List - Serious Memory Leaks with VDDK 1.1 on Linux</title>
    <link>http://communities.vmware.com/community/developer/forums/vddk?view=discussions</link>
    <description>Most recent forum messages</description>
    <language>en</language>
    <pubDate>Tue, 04 Aug 2009 14:52:13 GMT</pubDate>
    <generator>Clearspace 1.10.12 (http://jivesoftware.com/products/clearspace/)</generator>
    <dc:date>2009-08-04T14:52:13Z</dc:date>
    <dc:language>en</dc:language>
    <item>
      <title>Re: Serious Memory Leaks with VDDK 1.1 on Linux</title>
      <link>http://communities.vmware.com/message/1328680?tstart=0#1328680</link>
      <description>&lt;br /&gt;
Any update on this issue?  I'm seeing even more memory leaks on further calls to this library.&lt;br /&gt;
&lt;p /&gt;
  ==9440== LEAK SUMMARY:&lt;br /&gt;
==9440==    definitely lost: 17,202 bytes in 36 blocks.&lt;br /&gt;
==9440==    indirectly lost: 422,229 bytes in 9,384 blocks.&lt;br /&gt;
==9440==      possibly lost: 0 bytes in 0 blocks.&lt;br /&gt;
==9440==    still reachable: 82,564 bytes in 90 blocks.&lt;br /&gt;
==9440==         suppressed: 0 bytes in 0 blocks.&lt;br /&gt;
==9440== Reachable blocks (those to which a pointer was found) are not shown.&lt;br /&gt;
==9440== To see them, rerun with: --leak-check=full --show-reachable=yes&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
The biggest difference between my test program and Mitch's above is that I also called  VixDiskLib_GetInfo() after the VixDiskLib_Open() call, and then a corresponding VixDiskLib_FreeInfo() call right before the  VixDiskLib_Close() call.&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
I haven't run valgrind against IO calls yet, but that's a lot of memory to lose on just an init, connect, getinfo, freeinfo, close, disconnet,  exit chain of function calls.</description>
      <pubDate>Tue, 04 Aug 2009 14:52:13 GMT</pubDate>
      <author>UniBill</author>
      <guid>http://communities.vmware.com/message/1328680?tstart=0#1328680</guid>
      <dc:date>2009-08-04T14:52:13Z</dc:date>
      <clearspace:dateToText>3 months, 2 weeks ago</clearspace:dateToText>
    </item>
    <item>
      <title>Re: Serious Memory Leaks with VDDK 1.1 on Linux</title>
      <link>http://communities.vmware.com/message/1324530?tstart=0#1324530</link>
      <description>&lt;br /&gt;
I apologize for being so delayed, I have been working against a deadline but should be able to let you know more about this issue this week,&lt;br /&gt;
&lt;p /&gt;
Thanks for your patience,&lt;br /&gt;
&lt;p /&gt;
Sudarsan&lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;br /&gt;</description>
      <pubDate>Thu, 30 Jul 2009 00:33:54 GMT</pubDate>
      <author>sudarsan</author>
      <guid>http://communities.vmware.com/message/1324530?tstart=0#1324530</guid>
      <dc:date>2009-07-30T00:33:54Z</dc:date>
      <clearspace:dateToText>3 months, 3 weeks ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
    </item>
    <item>
      <title>Re: Serious Memory Leaks with VDDK 1.1 on Linux</title>
      <link>http://communities.vmware.com/message/1311672?tstart=0#1311672</link>
      <description>I believe most of the memory leaks we are seeing are a result of the Disk Open call.  However in the run we were profiling we were doing read and writes as well.  Its a little hard to tell due to the vast number of complaints being spewed by valgrind.  After seeing all the complaints I came to the forums to see if anyone else had seen the problem and came across your post.  We have not tried to narrow it down farther as you have done.&lt;br /&gt;
&lt;p /&gt;
John</description>
      <pubDate>Wed, 15 Jul 2009 14:15:25 GMT</pubDate>
      <author>unideskjohn</author>
      <guid>http://communities.vmware.com/message/1311672?tstart=0#1311672</guid>
      <dc:date>2009-07-15T14:15:25Z</dc:date>
      <clearspace:dateToText>4 months, 1 week ago</clearspace:dateToText>
    </item>
    <item>
      <title>Re: Serious Memory Leaks with VDDK 1.1 on Linux</title>
      <link>http://communities.vmware.com/message/1310819?tstart=0#1310819</link>
      <description>unideskjohn - Are you seeing memory leaks beyond just the Disk Open?  I'd be interested to know what else is leaking so we can be on the lookout.&lt;br /&gt;
&lt;p /&gt;
&lt;br /&gt;
-Mitch&lt;br /&gt;
mitch.haile@gmail.com&lt;br /&gt;
408-850-0129</description>
      <pubDate>Tue, 14 Jul 2009 18:25:17 GMT</pubDate>
      <author>Mitch Haile</author>
      <guid>http://communities.vmware.com/message/1310819?tstart=0#1310819</guid>
      <dc:date>2009-07-14T18:25:17Z</dc:date>
      <clearspace:dateToText>4 months, 1 week ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
    </item>
    <item>
      <title>Re: Serious Memory Leaks with VDDK 1.1 on Linux</title>
      <link>http://communities.vmware.com/message/1310800?tstart=0#1310800</link>
      <description>Any update on this?  We are seeing some significant memory leaks from the VIX libraries and the libraries it uses.</description>
      <pubDate>Tue, 14 Jul 2009 18:18:56 GMT</pubDate>
      <author>unideskjohn</author>
      <guid>http://communities.vmware.com/message/1310800?tstart=0#1310800</guid>
      <dc:date>2009-07-14T18:18:56Z</dc:date>
      <clearspace:dateToText>4 months, 1 week ago</clearspace:dateToText>
      <clearspace:replyCount>4</clearspace:replyCount>
    </item>
    <item>
      <title>Re: Serious Memory Leaks with VDDK 1.1 on Linux</title>
      <link>http://communities.vmware.com/message/1302920?tstart=0#1302920</link>
      <description>&lt;br /&gt;
Thanks for the message, let me take a look.&lt;br /&gt;
&lt;p /&gt;
-Sudarsan</description>
      <pubDate>Mon, 06 Jul 2009 05:17:58 GMT</pubDate>
      <author>sudarsan</author>
      <guid>http://communities.vmware.com/message/1302920?tstart=0#1302920</guid>
      <dc:date>2009-07-06T05:17:58Z</dc:date>
      <clearspace:dateToText>4 months, 2 weeks ago</clearspace:dateToText>
      <clearspace:replyCount>5</clearspace:replyCount>
    </item>
    <item>
      <title>Serious Memory Leaks with VDDK 1.1 on Linux</title>
      <link>http://communities.vmware.com/message/1302291?tstart=0#1302291</link>
      <description>&lt;br /&gt;
It appears in our testing that there exist serious memory leaks in VDDK on Linux 32 bit.  Any pointers would be appreciated. &lt;br /&gt;
&lt;p /&gt;
A sample program is at the end of this message.  With calls to VixDiskLib_Open() and Close(), no reading of data, each call to Open leaks a good chunk of memory.  The below valgrind output is from a single Open/Close pair.&lt;br /&gt;
&lt;p /&gt;
Over 1000 errors are reported, mostly out of libxml2 and libcurl. &lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;==715== &lt;br clear="all" /&gt; ==715== ERROR SUMMARY: 39170 errors from 1000 contexts (suppressed: 42 from 1) &lt;br clear="all" /&gt; ==715== malloc/free: in use at exit: 383,967 bytes in 8,033 blocks. &lt;br clear="all" /&gt; ==715== malloc/free: 19,217 allocs, 11,184 frees, 2,394,652 bytes allocated. &lt;br clear="all" /&gt; ==715== For counts of detected errors, rerun with: -v &lt;br clear="all" /&gt; ==715== searching for pointers to 8,033 not-freed blocks. &lt;br clear="all" /&gt; ==715== checked 2,474,068 bytes. &lt;br clear="all" /&gt; ==715== &lt;br clear="all" /&gt; ==715== LEAK SUMMARY: &lt;br clear="all" /&gt; ==715==    definitely lost: 366,477 bytes in 7,944 blocks. &lt;br clear="all" /&gt; ==715==      possibly lost: 0 bytes in 0 blocks. &lt;br clear="all" /&gt; ==715==    still reachable: 17,490 bytes in 89 blocks. &lt;br clear="all" /&gt; ==715==         suppressed: 0 bytes in 0 blocks. &lt;br clear="all" /&gt; ==715== Rerun with --leak-check=full to see details of leaked memory.&lt;/blockquote&gt;
&lt;br /&gt;
Without the call to VixDiskLib_Open() and Close(): &lt;br /&gt;
&lt;br /&gt;
&lt;blockquote&gt;==687== &lt;br clear="all" /&gt; ==687== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 25 from 1) &lt;br clear="all" /&gt; ==687== malloc/free: in use at exit: 39,651 bytes in 1,757 blocks. &lt;br clear="all" /&gt; ==687== malloc/free: 1,970 allocs, 213 frees, 137,174 bytes allocated. &lt;br clear="all" /&gt; ==687== For counts of detected errors, rerun with: -v &lt;br clear="all" /&gt; ==687== searching for pointers to 1,757 not-freed blocks. &lt;br clear="all" /&gt; ==687== checked 2,493,324 bytes. &lt;br clear="all" /&gt; ==687== &lt;br clear="all" /&gt; ==687== LEAK SUMMARY: &lt;br clear="all" /&gt; ==687==    definitely lost: 0 bytes in 0 blocks. &lt;br clear="all" /&gt; ==687==      possibly lost: 0 bytes in 0 blocks. &lt;br clear="all" /&gt; ==687==    still reachable: 39,651 bytes in 1,757 blocks. &lt;br clear="all" /&gt; ==687==         suppressed: 0 bytes in 0 blocks. &lt;br clear="all" /&gt; ==687== Rerun with --leak-check=full to see details of leaked memory.&lt;/blockquote&gt;
&lt;br /&gt;
 Here is a simple test case: &lt;br /&gt;
&lt;p /&gt;
&lt;p /&gt;
&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;vixDiskLib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#define VIXDISKLIB_VERSION_MAJOR 1&lt;br /&gt;
#define VIXDISKLIB_VERSION_MINOR 0&lt;br /&gt;
&lt;br /&gt;
#define VDDK_DISK_OPEN 1&lt;br /&gt;
&lt;br /&gt;
static void &lt;br /&gt;
panic_if_vixerror(VixError vixError, const char *func_name)&lt;br /&gt;
{&lt;br /&gt;
    if (VIX_FAILED(vixError)) {&lt;br /&gt;
        fprintf(stderr, "%s failed: %s\n", func_name, VixDiskLib_GetErrorText(vixError, NULL));&lt;br /&gt;
        exit(1);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    fprintf(stderr, "%s: OK\n", func_name);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
static void&lt;br /&gt;
init_connect_params(VixDiskLibConnectParams *cp)&lt;br /&gt;
{&lt;br /&gt;
    (void) memset(cp, 0, sizeof(*cp));&lt;br /&gt;
&lt;br /&gt;
    cp-&amp;gt;vmxSpec = NULL;&lt;br /&gt;
    cp-&amp;gt;serverName = "192.168.201.106";&lt;br /&gt;
    cp-&amp;gt;credType = VIXDISKLIB_CRED_UID;&lt;br /&gt;
    cp-&amp;gt;creds.uid.userName = "root";&lt;br /&gt;
    cp-&amp;gt;creds.uid.password = "abc123";&lt;br /&gt;
    cp-&amp;gt;port = 902;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int&lt;br /&gt;
main(int argc, char **argv)&lt;br /&gt;
{&lt;br /&gt;
    (void) argv;&lt;br /&gt;
&lt;br /&gt;
    VixError vixError;&lt;br /&gt;
    VixDiskLibConnection conn = NULL;&lt;br /&gt;
    VixDiskLibConnectParams cp;&lt;br /&gt;
&lt;br /&gt;
    if (argc &amp;lt;= 1) {&lt;br /&gt;
        fprintf(stderr, "Usage: $0 &amp;lt;vmdk path&amp;gt;\n");&lt;br /&gt;
        return 1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    init_connect_params(&amp;#38;cp);&lt;br /&gt;
&lt;br /&gt;
    vixError = VixDiskLib_Init(VIXDISKLIB_VERSION_MAJOR,&lt;br /&gt;
                               VIXDISKLIB_VERSION_MINOR,&lt;br /&gt;
                               NULL, NULL, NULL, // Log, warn, panic&lt;br /&gt;
                               NULL);   // libDir&lt;br /&gt;
    panic_if_vixerror(vixError, "VixDiskLib_Init");&lt;br /&gt;
&lt;br /&gt;
    vixError = VixDiskLib_Connect(&amp;#38;cp, &amp;#38;conn);&lt;br /&gt;
    panic_if_vixerror(vixError, "VixDiskLib_Connect");&lt;br /&gt;
&lt;br /&gt;
#if VDDK_DISK_OPEN&lt;br /&gt;
    {&lt;br /&gt;
        const char *disk_name = argv[1];&lt;br /&gt;
        VixDiskLibHandle disk_handle = NULL;&lt;br /&gt;
&lt;br /&gt;
        VixError vixError = VixDiskLib_Open(conn, disk_name, VIXDISKLIB_FLAG_OPEN_READ_ONLY, &amp;#38;disk_handle);&lt;br /&gt;
        panic_if_vixerror(vixError, "VixDiskLib_Open");&lt;br /&gt;
&lt;br /&gt;
        vixError = VixDiskLib_Close(disk_handle);&lt;br /&gt;
        panic_if_vixerror(vixError, "VixDiskLib_Close");&lt;br /&gt;
    }&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
    if (conn != NULL) {&lt;br /&gt;
        vixError = VixDiskLib_Disconnect(conn);&lt;br /&gt;
        panic_if_vixerror(vixError, "VixDiskLib_Disconnect");&lt;br /&gt;
        conn = NULL;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    VixDiskLib_Exit();&lt;br /&gt;
&lt;br /&gt;
    printf("--done--\n");&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
It doesn't seem to matter if VIXDISKLIB_VERSION_MINOR is 0 or 1.&lt;br /&gt;
&lt;br /&gt;
The code is built with:&lt;br /&gt;
&lt;p /&gt;
$ gcc -I/usr/lib/vmware-vix-disklib/include -L/usr/lib/vmware-vix-disklib/lib32 -g -lvixDiskLib -o testvddk test_vddk.c &lt;br /&gt;</description>
      <pubDate>Fri, 03 Jul 2009 22:07:17 GMT</pubDate>
      <author>Mitch Haile</author>
      <guid>http://communities.vmware.com/message/1302291?tstart=0#1302291</guid>
      <dc:date>2009-07-03T22:07:17Z</dc:date>
      <clearspace:dateToText>4 months, 3 weeks ago</clearspace:dateToText>
      <clearspace:replyCount>6</clearspace:replyCount>
    </item>
  </channel>
</rss>

