Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » OutOfMemory ScrollableCursor
OutOfMemory ScrollableCursor [message #666716] Thu, 21 April 2011 19:58 Go to next message
No real name is currently offline No real nameFriend
Messages: 3
Registered: April 2011
Junior Member
I got an out Of memory with a scrollablecursor

n*** Persistence started at Thu Apr 21 17:31:39 CEST 2011
[EL Info]: 2011-04-21 17:31:40.627--ServerSession(9489155)--Thread(Thread[main,5,m ain])--EclipseLink, version: Eclipse Persistence Services - 2.2.0.v20110202-r8913
[EL Fine]: 2011-04-21 17:31:41.012--Thread(Thread[main,5,main])--Detected Vendor platform: org.eclipse.persistence.platform.database.oracle.Oracle10Pla tform
[EL Config]: 2011-04-21 17:31:41.046--ServerSession(9489155)--Connection(17243268)-- Thread(Thread[main,5,main])--connecting(DatabaseLogin(
platform=>Oracle10Platform
user name=> "valqua07"
datasource URL=> "jdbc:oracle:thin:@localhost:1521:test"
))
[EL Config]: 2011-04-21 17:31:41.08--ServerSession(9489155)--Connection(31544052)--T hread(Thread[main,5,main])--Connected: jdbc:oracle:thin:@localhost:1521:test
User: VALQUA07
Database: Oracle Version: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Oracle Label Security, Oracle Database Vault and Real Application Testing options
Driver: Oracle JDBC driver Version: 11.2.0.1.0
[EL Info]: 2011-04-21 17:31:41.352--ServerSession(9489155)--Thread(Thread[main,5,m ain])--file:/C:/Programmes/OEPE11GR1/workspace/BTelJPA/build /classes/_BTelJPA login successful
[EL Fine]: 2011-04-21 17:31:41.422--ServerSession(9489155)--Connection(31544052)-- Thread(Thread[main,5,main])--SELECT t1.idntecpfesvc, t1.typpfesvc, t1.datrsipfesvc, t0.idntecpkgssc, t0.datdebpkgssc, t0.datfinpkgssc, t0.datsscpkgssc, t0.idntecpkgetu, t2.idntecfntoto, t2.idntecssc, t2.xprrlergpssc, t2.datdebrgpssc, t2.datfinrgpssc, t2.IDNRLERGPSSC, t2.CPRNBRCHGDAT, t3.idnccsssc, t3.ancdatrsiccsssc, t3.datcloccsssc, t3.datrsiccsssc, t3.datsscccsssc, t3.codfamccs, t3.idntecpfesvc, t3.inrdbtatrccs, t3.limcdtccs, t3.idntecccs FROM PFESVC t1 LEFT OUTER JOIN PKGETUSSC t0 ON (t0.idntecpfesvc = t1.idntecpfesvc) LEFT OUTER JOIN RLERGPSSC t2 ON (t2.idntecpfesvc = t1.idntecpfesvc) LEFT OUTER JOIN CCSSSC t3 ON (t3.idntecpfesvc = t1.idntecpfesvc) WHERE (t1.idntecpfesvc < ?)
bind => [313000]
[EL Config]: 2011-04-21 17:31:41.696--ServerSession(9489155)--Connection(6722010)--T hread(Thread[main,5,main])--connecting(DatabaseLogin(
platform=>Oracle10Platform
user name=> "valqua07"
datasource URL=> "jdbc:oracle:thin:@localhost:1521:test"
))
[EL Config]: 2011-04-21 17:31:41.74--ServerSession(9489155)--Connection(32609788)--T hread(Thread[main,5,main])--Connected: jdbc:oracle:thin:@localhost:1521:test
User: VALQUA07
Database: Oracle Version: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Oracle Label Security, Oracle Database Vault and Real Application Testing options
Driver: Oracle JDBC driver Version: 11.2.0.1.0
[EL Fine]: 2011-04-21 17:31:41.74--ServerSession(9489155)--Connection(32609788)--T hread(Thread[main,5,main])--SELECT t0.idntecpkgssc, t0.datdebpkgssc, t0.datfinpkgssc, t0.datsscpkgssc, t0.idntecpkgetu, t0.idntecpfesvc FROM PKGETUSSC t0, PFESVC t1 WHERE ((t0.idntecpfesvc = t1.idntecpfesvc) AND (t1.idntecpfesvc < ?))
bind => [313000]
[EL Fine]: 2011-04-21 17:31:50.977--ServerSession(9489155)--Connection(32609788)-- Thread(Thread[main,5,main])--SELECT t0.idnccsssc, t0.ancdatrsiccsssc, t0.datcloccsssc,

...............******************........

ValoPfi [_lIdPFI=131060, _cMode=I, _sDateInvalidation=Fri Dec 17 12:44:09 CET 2004, _vpsPack=9, _vpsSvcCustomOto=0, _vpsCcs=5]
ValoPfi [_lIdPFI=196354, _cMode=I, _sDateInvalidation=null, _vpsPack=47, _vpsSvcCustomOto=0, _vpsCcs=22]
ValoPfi [_lIdPFI=121988, _cMode=I, _sDateInvalidation=Sat Jul 22 08:59:18 CEST 2006, _vpsPack=22, _vpsSvcCustomOto=0, _vpsCcs=12]
ValoPfi [_lIdPFI=253355, _cMode=I, _sDateInvalidation=Sat Apr 08 16:51:29 CEST 2006, _vpsPack=12, _vpsSvcCustomOto=0, _vpsCcs=9]

number of Read = 3580

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at oracle.sql.NUMBER.toBigDecimal(NUMBER.java:635)
at oracle.sql.NUMBER.bigDecimalValue(NUMBER.java:2189)
at oracle.sql.NUMBER.toJdbc(NUMBER.java:2223)
at oracle.jdbc.driver.ScrollableResultSet.getObject(ScrollableR esultSet.java:1080)
at oracle.jdbc.driver.ScrollableResultSet.getObject(ScrollableR esultSet.java:996)
at org.eclipse.persistence.internal.databaseaccess.DatabasePlat form.getObjectFromResultSet(DatabasePlatform.java:1145)

The code is

public static void main(String[] args) {
DaoDb daoDb = new DaoDb();
ScrollableCursor scrollableCursor = daoDb.getScrollableCursor();

int compteur = 0;
Iterator<Object> ite = null;

while (scrollableCursor.hasNext()) {
List<Object> result = scrollableCursor.next(10);
compteur = compteur + result.size();

ite = result.iterator();
while (ite.hasNext()) {
System.out.println((ValoPfi)ite.next());
}

System.out.println(compteur);
}

Whith ScrollableCursor I was thinking that I got data by 10 so why the data are not cleaned by jvm after getting it...I have to read several millions of data and I crash at the 3580 Surprised)

Help

Thank you for all..

Christophe.
Re: OutOfMemory ScrollableCursor [message #667230 is a reply to message #666716] Wed, 27 April 2011 14:39 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

What does your, daoDb.getScrollableCursor() method do?

By default, all objects read through JPA are registered in the persistence context, so your persistence context will grow until you run out of memory.

You can either call clear() on your EntityManager after each 10, or set the "eclipselink.read-only" hint on the query.

You could also try using a weak persistence context.


James : Wiki : Book : Blog : Twitter
Previous Topic:JPA Dynamic Models
Next Topic:Howto map a map?
Goto Forum:
  


Current Time: Fri Apr 26 13:33:49 GMT 2024

Powered by FUDForum. Page generated in 0.02963 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top