java.lang.OutOfMemoryError: Java heap space when doing a JDBC read from Oracle

I get a java.lang.OutOfMemoryError: Java heap space message when reading from an 11g Oracle database via JDBC. I have the defaultRowPrefetch set to 10000, reducing it to 2000 seems to resolve the issue. However, adding additional memory to the JVM (-xmx) does NOT resolve the issue. This issue only seems to occur in 64-bit java 1.6 - I was not seeing this issue in 32-bit java.

My question, what setting can I change to allow my application to run with the larger defaultRowPrefetch?

-------------Problems Reply------------

You're editing the correct setting (although it's -Xmx, not -xmx), but it sounds like you need to increase it further, e.g.

-Xmx256m

As far as the 64 bit thing is concerned, you'll find that a 64bit JVM uses up heap much faster than a 32bit JVM (which makes sense, the pointers are twice the size), so a 64bit JVM needs more heap anyway.

Can't out of memory also come form a lack of PermGen? More to memory than just heap

-XX:MaxPermSize=128m

Category:java Views:2 Time:2010-06-21
Tags: java oracle

Related post

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.146 (s). 11 q(s)