pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Markus Angst <mangst@inventec.ch>
To: pgsql-odbc@lists.postgresql.org
Subject: Re: Out of memory while reading tuples
Date: Wed, 7 Nov 2018 18:11:57 +0100
Message-ID: <5c22c86e-6f8e-59b6-b271-38e53da61def@inventec.ch> (raw)
In-Reply-To: <0935d1c8-e51b-08de-5bfc-ca8c7546ee45@dream.email.ne.jp>
References: <ea322803-1214-8da5-c2cb-c81c6259daeb@inventec.ch>
	<ee5853fd-3e85-e5fc-8dd9-095501b594a1@dream.email.ne.jp>
	<1bfac4d7-64de-e9a0-e1ba-744b546a1bfb@dream.email.ne.jp>
	<e100eabc-2688-a9e6-9380-c144e92ebb31@inventec.ch>
	<0935d1c8-e51b-08de-5bfc-ca8c7546ee45@dream.email.ne.jp>

>>>>> Postgres 10.4 64bit on Windows
>>>>> psqlODBC 10.03.0000
>>>>> - Use Declare/Fetch is off
>>>>> - Cache size is 10'000'000
>>>>>
>>>>> Issuing a simple select statement with Microsoft Access gives me the
>>>>> following ODBC error:
>>>>>
>>>>> "Out of memory while reading tuples.; memory allocation error??? (#4)"
>>>>>
>>>>> The statement returns 822701 rows (via JDBC), average row size is 100
>>>>> bytes.
>>>>>
>>>>> On https://odbc.postgresql.org/docs/config.html it says:
>>>>> "Cache Size: When using cursors, this is the row size of the tuple
>>>>> cache. If not using cursors, this is how many tuples to allocate
>>>>> memory for at any given time. The default is 100 rows for either
>>>>> case."
>>>>
>>>> Hmm, it seems a documentation bug to me.
>>>>
>>>>     "If not using cursors, this is how many tuples to allocate memory at
>>>> first."
>>>>
>>>> seems correct.
>>>
>>> Oops, I was wrong.
>>>
>>>      "If not using cursors, this has no meaning."
>>>
>>> seems right.
>>
>> Thanks for your reply. What is the exact memory limit (and, out of
>> curiosity: why does it exist)?
> 
> Psqlodbc itself doesn't have such a limitation. *Out of memory* means
> that psqlodbc requested
> a memory area using m(re)alloc function but the system replied that it's
> a tall order.

Well, I don't know enough about the inner workings of windows, but the RAM usage 
goes up from about 200 MB to about 400 MB before the message appears (with only 
the Access client running on this machine that has 4 GB of RAM). That doesn't 
sound too tight to me.

> BTW simple queries rather consume large amount of memory.
> Could you narrow down the conditions of your queries?

Yes, I could, but it would be somewhat artificial, because it is a data export :-)

Anyway, I am about to switch this particular export to ADO/OLEDB to circumvent 
the problem.

Thank you
Markus




view thread (7+ messages)

Message-ID: <5c22c86e-6f8e-59b6-b271-38e53da61def@inventec.ch>
Permalink:  ../5c22c86e-6f8e-59b6-b271-38e53da61def@inventec.ch/
Also on:    postgresql.org/message-id/5c22c86e-6f8e-59b6-b271-38e53da61def@inventec.ch

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: mangst@inventec.ch
  Subject: Re: Out of memory while reading tuples
  In-Reply-To: <5c22c86e-6f8e-59b6-b271-38e53da61def@inventec.ch>
  References: <ea322803-1214-8da5-c2cb-c81c6259daeb@inventec.ch> <ee5853fd-3e85-e5fc-8dd9-095501b594a1@dream.email.ne.jp> <1bfac4d7-64de-e9a0-e1ba-744b546a1bfb@dream.email.ne.jp> <e100eabc-2688-a9e6-9380-c144e92ebb31@inventec.ch> <0935d1c8-e51b-08de-5bfc-ca8c7546ee45@dream.email.ne.jp> <5c22c86e-6f8e-59b6-b271-38e53da61def@inventec.ch>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox