then before i stop working on these 1000 objects, I dispose the connection object and the csValues callablestatement also.
But still it fails saying Out of memory exception.
This is what it says exactly
Exception in thread "main" java.lang.OutOfMemoryError at oracle.jdbc.driver.OracleStatement.prepareAccessors(OracleStatement.java:879)
at oracle.jdbc.driver.T4CResultSetAccessor.getCursor(T4CResultSetAccessor.java:315)
at oracle.jdbc.driver.OracleCallableStatement.getCursor(OracleCallableStatement.java:1659)
Please provide any thoughts
Now here is how I generate sublists.. I am thinking that I keep on creating list objects.. so even though Its working on 1000 objects at a time, the previously creating objects are still existing in memory.
Am I correct ?
this is a sample method I have which I use to create sublist
Thanks
Atul
[NK: Added code tags]
This message was edited 4 times. Last update was at by Bear Bibeault
Atul Mishra
Ranch Hand
Joined: Jun 08, 2006
Posts: 140
posted
0
Could any one please provide inputs ?
Thanks
Satya Maheshwari
Ranch Hand
Joined: Jan 01, 2007
Posts: 359
posted
0
Please use code tags for posting code.
Is it possible to profile your code to see, what is exactly eating up the memory?
Also, can you post the code in processTestObj?
Add the JVM option -XX:+DumpHeapOnOutOfMemoryError to your app's command line. The JVM will then create a *.hprof file in the current directory when it runs out of heap. Load that file into VisualVM (it comes with JDK6) and it will tell you what is in memory.
If you are running JDK 6, you can attach VisualVM to the JVM running your app and take intermittent memory snapshot and have VisualVM compare them to see what changed in the heap.
1. satya - sorry I used "quotes".. will use code tags going ahead.
What I am thinking is since I am storing all objects in the collection, Collections[Lists] eat up memory.
Hence I am trying to see whether I can get chunks of resultset and processs the chunks rather than loading all 20K [or even 50K] to collection at once..
Do you agree ?
Thanks Peter and Kri Shan
Peter-we dont have 1.6 yet, still in 1.5
and also i dont think the company will allow modifying prod file to do it.
I will give a try
That is not a problem. I worked an OOME issue with one of our customers a few weeks back - they are using JDK 5. I had them set -XX:+DumpHeapOnOutOfMemoryError and then load the hprof file into the VisualVM installed on one of their laptops. You do not have to change the JDK for your production environment to make use of the features in VisualVM.
Atul Mishra
Ranch Hand
Joined: Jun 08, 2006
Posts: 140
posted
0
Peter,
I should just get VisualVM from Jdk 1.6 ?
Trying to download 1.6 and install it on my machine.
Then I will change the jvm option in the AIX machine and get the file.
Will let you know what I find out.
I did it, and added this to the shell script which calls the program
-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=file:///oom.hprof
but I dont see a file. Am i missing any ?
Thanks
Atul
This message was edited 2 times. Last update was at by Atul Mishra
Oh, you are using AIX. You should always say that you are not using the Sun JDK when asking questions because that is what is assumed. The AIX JVM does thing differently than the Sun JVM. But look at the AIX JVM docs to see if there is any tool for analyzing the files that it produced.
Atul Mishra
Ranch Hand
Joined: Jun 08, 2006
Posts: 140
posted
0
Oh sorry..
Could anyone please suggest any ways to analyze this in AIX environment ?
Thanks
kri shan
Ranch Hand
Joined: Apr 08, 2004
Posts: 1235
posted
0
Better contact IBM guys. We had similar kind of issue in AIX, IBM send the patch and AIX specific tuning parameters to us.