Reputation: 1
I checked all my Connection are closed properly.still am getting java.lang.OutOfMemoryError: Java heap space.why I am getting OutOfMemoryError.can you please suggest what I need to check.Is there any way to resolve without increase heap size. I dint have chance to increas heap.please provide any solution
2013-01-18 02:42:11,487|INFO||GatewayOutboundPollerDaemon|Begin pollGatewayIncident().
2013-01-18 02:42:32,225|INFO||GatewayOutboundPollerDbHelper|Begin submitPendingRecords().
2013-01-18 02:42:54,565|INFO||GatewayOutboundPollerDbHelper|Query for Pending Records : SELECT TR_GATEWAY_RECORD_ID, decode(TR_TRANSACTION_TY
PE,1,'Update','Create')TR_TRANSACTION_TYPE, TR_GATEWAY_RECORD_STATUS FROM TM4530_INCIDENT_GATEWAY WHERE TR_GATEWAY_RECORD_STATUS = 0 AND TR_F
ROM_PARTNER = 'RAM' AND TR_GATEWAY_RECORD_STATE = 0 AND TR_TRANSACTION_METHOD = 1 FOR UPDATE
2013-01-18 02:49:47,527|ERROR||DaemonExecutor|ExecutableDaemon threw an exception:
java.lang.OutOfMemoryError: Java heap space
Upvotes: 0
Views: 87
Reputation: 1520
How big is the dataset you are working with? It looks like your query returns millions of records filling up memory... Try using (if possible) a ResultSet or limiting the data, to restrict the amount of records in memory
Upvotes: 0
Reputation: 30875
You can use CodePro Analytix, to analyse your code against that code defect.
Upvotes: 0
Reputation: 3407
From the logs, it looks like your are doing SQL select
How large is the resultset that you are querying out? If its returning a huge data set which consumes memory, then it can result in OutOfMemory
Upvotes: 1
Reputation: 1669
You should probably simply raise the memory assigned to your program. Check your -Xmx and -Xms properties.
Upvotes: 0
Reputation: 533740
You need to check which objects are using the most memory e.g.
jmap -histo:live {pid} | head -30
At a guess you could be forgetting to close all you JDBC resources which will accumulate if your don't.
Upvotes: 2