pg.ddx.io pgsql-odbc@postgresql.org mailing list archive
help / color / mirror / Atom feedOut of memory while reading tuples
7+ messages / 3 participants
[nested] [flat]
* Out of memory while reading tuples
@ 2007-11-20 17:39 Garner Chung <garner@nuws.com>
0 siblings, 0 replies; 7+ messages in thread
From: Garner Chung @ 2007-11-20 17:39 UTC (permalink / raw)
To: pgsql-odbc
We are getting an "Out of memory while reading tuples" error while
iterating through a large record set. Our environment can be roughly
described as MS Access with linked tables connecting to a PG backend
through ODBC. The ODBC Driver version is PostgreSQL Unicode 8.02.05.00.
We understand that the "Use Declare/Fetch" setting would probably
circumvent this problem. However that setting has posed challenges for
us in the past. Those challenges were significant enough that we'd
deliberately chosen to run our application with that setting off.
So before diving back into figuring workarounds for those challenges, we
are wondering if there is any way of increasing the memory overhead of
the ODBC connection. We'll go further out on a limb and ask, is this
simply a bug in the ODBC driver? When this occurs it appears as if there
is plenty of physical memory available on the machine. And while I'm not
sure if the ODBC driver's memory allocation would appear under the
MSACCESS.EXE process, MS Access often doesn't appear to allocate more
than 512MB for itself.
I have a mylog prepared already should that be of benefit to you all.
You all have been very helpful to us in the past, so thanks again for
your time and energy...
-Garner
^ permalink raw reply [nested|flat] 7+ messages in thread
* Out of memory while reading tuples
@ 2018-11-05 22:34 Markus Angst <mangst@inventec.ch>
0 siblings, 1 reply; 7+ messages in thread
From: Markus Angst @ 2018-11-05 22:34 UTC (permalink / raw)
To: pgsql-odbc
Hi,
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."
Setting the field to the aforementioned 10'000'000 does not help. Is this value
ignored? Is there a maximum value for Cache size? How is the tuple size calculated?
Setting Use Declare/Fetch is not an option. Access can have severe problems with
this setting; an experience I don't want to repeat.
My plan B would be to select the data in several pieces, which would be much
more complicated in this particular case.
What else can I do?
Thanks and best regards
Markus Angst
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Out of memory while reading tuples
@ 2018-11-06 04:21 Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
parent: Markus Angst <mangst@inventec.ch>
0 siblings, 1 reply; 7+ messages in thread
From: Inoue, Hiroshi @ 2018-11-06 04:21 UTC (permalink / raw)
To: Markus Angst <mangst@inventec.ch>; +Cc: pgsql-odbc
Hi Markus,
On 2018/11/06 7:34, Markus Angst wrote:
> Hi,
>
> 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.
So "Cache size" doesn't have much meaning if *Use Declare/Fetch* is off.
I think there's no way to avoid *Out of memory while reading tuples* errors
in *Use Declare/Fetch* off mode unfortunately.
regards,
Hiroshi inoue
>
>
> Setting the field to the aforementioned 10'000'000 does not help. Is
> this value ignored? Is there a maximum value for Cache size? How is
> the tuple size calculated?
>
> Setting Use Declare/Fetch is not an option. Access can have severe
> problems with this setting; an experience I don't want to repeat.
>
> My plan B would be to select the data in several pieces, which would
> be much more complicated in this particular case.
>
> What else can I do?
>
> Thanks and best regards
> Markus Angst
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Out of memory while reading tuples
@ 2018-11-06 12:17 Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
parent: Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
0 siblings, 1 reply; 7+ messages in thread
From: Inoue, Hiroshi @ 2018-11-06 12:17 UTC (permalink / raw)
To: Markus Angst <mangst@inventec.ch>; +Cc: pgsql-odbc
On 2018/11/06 13:21, Inoue, Hiroshi wrote:
> Hi Markus,
>
> On 2018/11/06 7:34, Markus Angst wrote:
>> Hi,
>>
>> 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.
>
> So "Cache size" doesn't have much meaning if *Use Declare/Fetch* is off.
> I think there's no way to avoid *Out of memory while reading tuples*
> errors
> in *Use Declare/Fetch* off mode unfortunately.
>
> regards,
> Hiroshi inoue
>
>>
>>
>> Setting the field to the aforementioned 10'000'000 does not help. Is
>> this value ignored? Is there a maximum value for Cache size? How is
>> the tuple size calculated?
>>
>> Setting Use Declare/Fetch is not an option. Access can have severe
>> problems with this setting; an experience I don't want to repeat.
>>
>> My plan B would be to select the data in several pieces, which would
>> be much more complicated in this particular case.
>>
>> What else can I do?
>>
>> Thanks and best regards
>> Markus Angst
---
このメールは、AVG によってウイルス チェックされています。
http://www.avg.com
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Out of memory while reading tuples
@ 2018-11-06 16:10 Markus Angst <mangst@inventec.ch>
parent: Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
0 siblings, 1 reply; 7+ messages in thread
From: Markus Angst @ 2018-11-06 16:10 UTC (permalink / raw)
To: pgsql-odbc@lists.postgresql.org
Hi Hiroshi,
>>> 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)?
Regards
Markus Angst
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Out of memory while reading tuples
@ 2018-11-07 02:17 Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
parent: Markus Angst <mangst@inventec.ch>
0 siblings, 1 reply; 7+ messages in thread
From: Inoue, Hiroshi @ 2018-11-07 02:17 UTC (permalink / raw)
To: Markus Angst <mangst@inventec.ch>; +Cc: pgsql-odbc
On 2018/11/07 1:10, Markus Angst wrote:
> Hi Hiroshi,
>
>>>> 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.
BTW simple queries rather consume large amount of memory.
Could you narrow down the conditions of your queries?
regards,
Hiroshi Inoue
>
> Regards
> Markus Angst
---
このメールは、AVG によってウイルス チェックされています。
http://www.avg.com
^ permalink raw reply [nested|flat] 7+ messages in thread
* Re: Out of memory while reading tuples
@ 2018-11-07 17:11 Markus Angst <mangst@inventec.ch>
parent: Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
0 siblings, 0 replies; 7+ messages in thread
From: Markus Angst @ 2018-11-07 17:11 UTC (permalink / raw)
To: pgsql-odbc@lists.postgresql.org
>>>>> 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
^ permalink raw reply [nested|flat] 7+ messages in thread
end of thread, other threads:[~2018-11-07 17:11 UTC | newest]
Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-11-20 17:39 Out of memory while reading tuples Garner Chung <garner@nuws.com>
2018-11-05 22:34 Out of memory while reading tuples Markus Angst <mangst@inventec.ch>
2018-11-06 04:21 ` Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
2018-11-06 12:17 ` Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
2018-11-06 16:10 ` Markus Angst <mangst@inventec.ch>
2018-11-07 02:17 ` Inoue, Hiroshi <h-inoue@dream.email.ne.jp>
2018-11-07 17:11 ` Markus Angst <mangst@inventec.ch>
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