Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xwy8x-0006sP-Ln for pgsql-odbc@arkaria.postgresql.org; Fri, 05 Dec 2014 19:02:19 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Xwy8x-0006l1-39 for pgsql-odbc@arkaria.postgresql.org; Fri, 05 Dec 2014 19:02:19 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Xwy8w-0006kv-HO for pgsql-odbc@postgresql.org; Fri, 05 Dec 2014 19:02:18 +0000 Received: from smtp-outbound-2.vmware.com ([208.91.2.13]) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1Xwy8s-0001xk-Fq for pgsql-odbc@postgresql.org; Fri, 05 Dec 2014 19:02:16 +0000 Received: from sc9-mailhost3.vmware.com (sc9-mailhost3.vmware.com [10.113.161.73]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id F0BB0291A3 for ; Fri, 5 Dec 2014 11:02:11 -0800 (PST) Received: from EX13-CAS-011.vmware.com (EX13-CAS-011.vmware.com [10.113.191.63]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id EAB6C41338 for ; Fri, 5 Dec 2014 11:02:05 -0800 (PST) Received: from EX13-MBX-021.vmware.com (10.113.191.41) by EX13-MBX-012.vmware.com (10.113.191.32) with Microsoft SMTP Server (TLS) id 15.0.913.22; Fri, 5 Dec 2014 11:03:00 -0800 Received: from altair.prom.eng.vmware.com (10.113.160.246) by EX13-MBX-021.vmware.com (10.113.191.41) with Microsoft SMTP Server (TLS) id 15.0.913.22; Fri, 5 Dec 2014 11:01:52 -0800 Message-ID: <5482011E.4050800@vmware.com> Date: Fri, 5 Dec 2014 11:01:50 -0800 From: Nikhil Deshpande User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: Subject: Re: SQLFreeHandle() takes eons when running debug References: In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.113.160.246] X-ClientProxiedBy: EX13-CAS-013.vmware.com (10.113.191.65) To EX13-MBX-021.vmware.com (10.113.191.41) X-Pg-Spam-Score: -6.9 (------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org On 12/5/14 10:56 AM, Eric Hill wrote: > Not sure how this could be the PostgreSQL ODBC driver’s fault, but when > I run a debug build of my application, calls to SQLFreeHandle() to free > a statement can have for quite a long time (we’re talking a minute or > two) before proceeding. This is Windows, 64-bit Unicode, version > 9.03.03 of the PG ODBC driver. The call stack looks like this when paused: > > ntdll.dll!RtlCompareMemoryUlong() + 0x10 bytes > > ntdll.dll!RtlpFreeHeap() + 0x113f bytes > > ntdll.dll!RtlFreeHeap() + 0x1df bytes > > ntdll.dll!RtlDebugFreeHeap() + 0x23f bytes > > ntdll.dll!RtlpFreeHeap() + 0x7d5b7 bytes > > ntdll.dll!RtlFreeHeap() + 0x1df bytes > > msvcr100.dll!free() + 0x1c bytes > > psqlodbc35w.dll!00007ff97bc7c827() > > [Frames below may be incorrect and/or missing, no > symbols loaded for psqlodbc35w.dll] > > psqlodbc35w.dll!00007ff97bc7656b() > > psqlodbc35w.dll!00007ff97bc76044() > > psqlodbc35w.dll!00007ff97bc761c7() > > psqlodbc35w.dll!00007ff97bc88781() > > psqlodbc35w.dll!00007ff97bc66bda() > > odbc32.dll!FreeStmt() + 0x2c5 bytes > > odbc32.dll!SQLFreeHandle() + 0x2a0 bytes > > > Jmp.exe!DBContext::freeStmt(void * & > hstmt=0x000000001f032030) Line 1644 + 0x14 bytes C++ > > Running a release build, no such delay. We don’t see anything like this > for SQL Server, Oracle, DB2, Teradata, or MySQL ODBC drivers. Anyone > run into this before that can suggest a fix or workaround? Perhaps this might be relevant (setting _NO_DEBUG_HEAP=1 env var to skip heap validation): http://stackoverflow.com/a/18753164 Thanks, Nikhil -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc