Re: java.lang.OutOfMemory Exception with a large number of inserts

Поиск
Список
Период
Сортировка
От Rene Pijlman
Тема Re: java.lang.OutOfMemory Exception with a large number of inserts
Дата
Msg-id BEELJGLKPCMDGFENPBPNCENODKAA.rene@lab.applinet.nl
обсуждение исходный текст
Ответ на java.lang.OutOfMemory Exception with a large number of inserts  ("Arsalan Zaidi" <azaidi@directi.com>)
Список pgsql-jdbc
You wrote:
> Here's the offending loop. BTW, I messed up with the
> total number of rows, it's ~6,000,000, not 600,000.
[...]
>   while(dbResult.next())

Unfortunately, PostgreSQL clients always retrieve the entire
resultset from the server before it is processed by the .next()
loop.

In your case this means that the 6.000.000 rows are first read
by the Java client into one huge ResultSet. This will no doubt
require much more than 50M of memory.

Can't you perform this operation in one or more SQL statements
or procedurally in PLSQL on the server, instead of retrieving
all data to the client?

Cheers,
René Pijlman


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: David Siebert
Дата:
Сообщение: Still getting the timestamp error.
Следующее
От: Roger Oed
Дата:
Сообщение: JDBC 2.0