1

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?

1
  • Heya keith, default defaultRowPrefetch ist 10, I got strong improvements by setting it to 250. I think even 2000 is very high compared to the default. Commented Jan 5, 2012 at 13:37

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

-XX:+UseCompressedOops helps to reduce the heap size on 64-bit JVM's, with a slight performance penalty incurred.
1

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

-XX:MaxPermSize=128m

1 Comment

It can. But if it does' the OOME's error message will tell you that you are out of permgen space. If it doesn't tell you, you would be wise not to twiddle that particular knob! Besides, permgen space is unlikely to be relevant to reading a JDBC resultset.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.