-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Scrollable results / session timeout / out of memory
PostPosted: Tue Jun 19, 2007 1:07 pm 
Newbie

Joined: Tue Nov 14, 2006 8:56 am
Posts: 1
Location: Villeta, Paraguay
I'm trying to get a huge amount or records from the db, I'm just getting the Ids from these objects to minimize the data read

while iterating the scrollableContracts.next() result I'm getting, sometimes out of memory errors and sometimes (more often) session time out

errors:
11:50:28,484 WARN [TimeScheduler] task org.jgroups.protocols.pbcast.STABLE$StableTask@aa9567 took 47922ms to execute, please check why it is taking so long. It is delaying other tasks
11:50:45,734 INFO [STDOUT] 11687
11:50:51,734 INFO [STDOUT] 11688
11:50:55,953 INFO [STDOUT] 11689
11:51:20,687 ERROR [TimeScheduler] failed running task org.jgroups.protocols.pbcast.STABLE$StableTask@aa9567
java.lang.OutOfMemoryError: Java heap space
---------------------------------------------------------------------
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0xc10e4773, pid=9608, tid=5460
#
# Java VM: Java HotSpot(TM) Client VM (1.5.0_11-b03 mixed mode)
# Problematic frame:
# C 0xc10e4773

---------------------------------------------------------------------
12:07:48,750 ERROR [UDP] failed sending message
java.lang.OutOfMemoryError: Java heap space
12:07:48,750 ERROR [ContainerBase] Exception invoking periodic operation:
java.lang.OutOfMemoryError: Java heap space
12:07:49,750 WARN [DiskStore] py.com.wpg.coopy.crm.entity.security.UserGroupCache: Expiry thread throwable caught. Message was: Java heap space. Continuing...
java.lang.OutOfMemoryError: Java heap space
12:07:49,750 ERROR [UDP] failed unmarshalling message
java.lang.OutOfMemoryError: Java heap space
12:08:02,937 WARN [UpHandler] UpHandler (FD) caught exception
java.lang.NoClassDefFoundError: org/jgroups/stack/Retransmitter$Task
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at org.jboss.mx.loading.RepositoryClassLoader.findClassLocally(RepositoryClassLoader.java:672)
at org.jboss.mx.loading.RepositoryClassLoader.findClass(RepositoryClassLoader.java:652)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at org.jboss.mx.loading.RepositoryClassLoader.loadClassLocally(RepositoryClassLoader.java:190)
at org.jboss.mx.loading.ClassLoadingTask$ThreadTask.run(ClassLoadingTask.java:131)
at org.jboss.mx.loading.LoadMgr3.nextTask(LoadMgr3.java:399)
at org.jboss.mx.loading.RepositoryClassLoader.loadClassImpl(RepositoryClassLoader.java:517)
at org.jboss.mx.loading.RepositoryClassLoader.loadClass(RepositoryClassLoader.java:405)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at org.jgroups.stack.Retransmitter.add(Retransmitter.java:104)
at org.jgroups.stack.NakReceiverWindow.add(NakReceiverWindow.java:228)
at org.jgroups.protocols.pbcast.NAKACK.handleMessage(NAKACK.java:637)
at org.jgroups.protocols.pbcast.NAKACK.up(NAKACK.java:508)
at org.jgroups.stack.Protocol.receiveUpEvent(Protocol.java:488)
at org.jgroups.stack.Protocol.passUp(Protocol.java:538)
at org.jgroups.protocols.VERIFY_SUSPECT.up(VERIFY_SUSPECT.java:119)
at org.jgroups.stack.Protocol.receiveUpEvent(Protocol.java:488)
at org.jgroups.stack.Protocol.passUp(Protocol.java:538)
at org.jgroups.protocols.FD.up(FD.java:274)
at org.jgroups.stack.UpHandler.run(Protocol.java:59)
12:08:02,937 WARN [TimeScheduler] task org.jgroups.protocols.pbcast.STABLE$StableTask@e21f5d took 11391ms to execute, please check why it is taking so long. It is delaying other tasks
12:08:35,328 ERROR [STDERR] Exception in thread "PingWaiter"
12:08:35,328 ERROR [STDERR] java.lang.OutOfMemoryError: Java heap space
12:08:36,218 ERROR [STDERR] Exception in thread "TimeScheduler.Thread"
12:08:36,218 ERROR [STDERR] java.lang.reflect.UndeclaredThrowableException
12:08:36,218 ERROR [STDERR] at org.apache.commons.logging.impl.Log4jProxy.log(Log4jProxy.java:296)
12:08:36,218 ERROR [STDERR] at org.apache.commons.logging.impl.Log4jProxy.error(Log4jProxy.java:270)
12:08:36,218 ERROR [STDERR] at org.apache.commons.logging.impl.Log4JLogger.error(Log4JLogger.java:119)
12:08:37,156 ERROR [STDERR] at org.jgroups.util.TimeScheduler$Loop.run(TimeScheduler.java:144)
12:08:37,156 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
12:08:37,156 ERROR [STDERR] Caused by: java.lang.OutOfMemoryError: Java heap space


I'm running in the server-side, not in the client-side, so, where to fix the problem ?

this is the code:
Code:
    List<String> activecontracts = new Vector<String>();

    ScrollableResults scrollableContracts = ContractLookup.getLookup().getContracts(searchparameters);
    int count = 0;
    if(scrollableContracts!=null)
      {
      try
        {
        while(scrollableContracts.next())
          {
          count++;
          System.out.println(count);// just to check the amount of records got before the error
          Contract contract = (Contract) scrollableContracts.get(0);
          if(contract.getState()!=null)
            {
            activecontracts.add(contract.getCode());
            }
          }
        scrollableContracts.close();
        }
      catch (Exception e)
        {
        e.printStackTrace();
        }
      }
    return activecontracts;
    }


and this is the code fro the session criteria:
Code:
    Session session = getSession();
    Criteria crit = session.createCriteria(Contract.class);
    if(activeOnly != null)
      {
      crit.add(Expression.or(Expression.isNull("endDate"),
               Expression.or(Expression.leProperty("endDate", "startDate"),
               Expression.gt("endDate", WPGCalendar.getToday()))));
      }
    if((contracttypes != null) && (!contracttypes.isEmpty()))
      {
      crit.add(Expression.in("type", contracttypes));
      }

    crit.setFetchSize(100);
    crit.setFlushMode(FlushMode.AUTO);
    return crit.scroll(ScrollMode.FORWARD_ONLY);//to optimize resources


[/b]

_________________
Betto McRose G,


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 09, 2007 8:35 am 
Newbie

Joined: Tue Feb 06, 2007 11:20 am
Posts: 2
Hi Icarus,

Did you find a way out, because I got same problem, any help would be very appreciated

Thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.