[postgis-users] JDBC OutofMemoryError

Gustavo Henrique Sberze Ribas gribas at cpqd.com.br
Thu Aug 4 14:58:32 PDT 2005


Hi,

  Hmmmm, try setting the fetchSize to something plausible. 

"http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Statement.html#setFetchSize(int)"


--
Gustavo 

-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net]On Behalf Of Akira Komo
Sent: Thursday, August 04, 2005 2:42 PM
To: PostGIS Users Discussion
Subject: RE: [postgis-users] JDBC OutofMemoryError


Gustavo,
I tried to give more memory to Java Virtual Machine, It doesn't help. I think a JDBC driver should not depend on the size of a ResultSet, otherwise how I can fetch all the records from a huge database. I wrote a JDBC driver for a previous project before. Actually we have a buffer at the client side, each time only 256 records were downloaded from the server, when a user calls next() 256 times, we download another chunk records of 256 records into the buffer. So no matter how large the resultset is, it doesn't matter at the client side. At least no OutOfMemoryError unless the resultset has thousands columns, :).
In my case, each record contains only 1. I'm so confusing.  how could it get OutOfMemoryError?    

Thank you again for your kind assistant.

-- Kai
----- Original Message ----- 
From: "Gustavo Henrique Sberze Ribas" 
To: "PostGIS Users Discussion" 
Subject: RE: [postgis-users] JDBC OutofMemoryError 
Date: Thu, 4 Aug 2005 08:02:08 -0300 

> 
> Hello, 
> 
> A few things to try out: 
> 
> - Narrow down your search (use WHERE); 
> - Limit the number of rows returned (use LIMIT); 
> - Give Java more memory: java -Xmx512M MyProgram 
> 
> 
> -- 
> Gustavo 
> 
> -----Original Message----- 
> From: postgis-users-bounces at postgis.refractions.net 
> [mailto:postgis-users-bounces at postgis.refractions.net]On Behalf Of 
> Akira Komo 
> Sent: Wednesday, August 03, 2005 5:28 PM 
> To: postgis-users at postgis.refractions.net 
> Subject: [postgis-users] JDBC OutofMemoryError 
> 
> 
> Dear all, 
> I have two small tables arizona_geo and colorado_geo in PostGIS 
> which were converted from two shapefiles. Each of them has only 
> several hundreds records. When I tried to issue a very simple query via 
> JDBC connection, I always got an OutOfMemoryError. One example 
> query is 
> select 1 from arizona_geo X, colorado_geo Y 
> I tried different postgresql JDBC driver with postgis extension, basically 
> I got the same error. I am very appreciated if somebody can give me an 
> idea to solve this problem. 
> -- Kumo 
> 
> 
> 
> -- 
> ___________________________________________________________ 
> Sign-up for Ads Free at Mail.com 
> http://www.mail.com/?sr=signup 
> _______________________________________________ 
> postgis-users mailing list 
> postgis-users at postgis.refractions.net 
> http://postgis.refractions.net/mailman/listinfo/postgis-users 


-- 
___________________________________________________________
Sign-up for Ads Free at Mail.com
http://www.mail.com/?sr=signup



More information about the postgis-users mailing list