openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "C N Davies" <...@cndavies.com>
Subject RE: Slice: OutOfMemoryError shortly after pounding 1000+ threads to the system.
Date Tue, 04 May 2010 01:33:13 GMT
I had this issue a lot on OpenJPA 1.2.2, I found that doing a clear after
committing a specified number of record kept things going.


Chris



-----Original Message-----
From: ssso [mailto:simonso@yahoo.com] 
Sent: Tuesday, 4 May 2010 9:43 AM
To: users@openjpa.apache.org
Subject: Slice: OutOfMemoryError shortly after pounding 1000+ threads to the
system.


I have a very simple spring web app, inserting an order into the database.

After pounding 500+ threads or so, I got an OutOfMemoryError:

java.lang.OutOfMemoryError: unable to create new native thread
        at java.lang.Thread.start0(Native Method)
        at java.lang.Thread.start(Thread.java:597)
        at
java.util.concurrent.ThreadPoolExecutor.addIfUnderCorePoolSize(ThreadPoolExe
cutor.java:703)
        at
java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:652)
        at
java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.
java:92)
        at
org.apache.openjpa.slice.jdbc.DistributedJDBCStoreManager.flush(DistributedJ
DBCStoreManager.java:290)
        at
org.apache.openjpa.kernel.DelegatingStoreManager.flush(DelegatingStoreManage
r.java:131)
        at org.apache.openjpa.kernel.BrokerImpl.flush(BrokerImpl.java:2139)
        at
org.apache.openjpa.kernel.BrokerImpl.flushSafe(BrokerImpl.java:2037)
        at
org.apache.openjpa.kernel.BrokerImpl.beforeCompletion(BrokerImpl.java:1955)
        at
org.apache.openjpa.kernel.LocalManagedRuntime.commit(LocalManagedRuntime.jav
a:81)
        at org.apache.openjpa.kernel.BrokerImpl.commit(BrokerImpl.java:1479)
        at
org.apache.openjpa.kernel.DelegatingBroker.commit(DelegatingBroker.java:925)
        at
org.apache.openjpa.persistence.EntityManagerImpl.commit(EntityManagerImpl.ja
va:559)
        at
org.springframework.orm.jpa.JpaTransactionManager.doCommit(JpaTransactionMan
ager.java:467)
        at
org.springframework.transaction.support.AbstractPlatformTransactionManager.p
rocessCommit(AbstractPlatformTransactionManager.java:754)
        at
org.springframework.transaction.support.AbstractPlatformTransactionManager.c
ommit(AbstractPlatformTransactionManager.java:723)
        at
org.springframework.transaction.interceptor.TransactionAspectSupport.commitT
ransactionAfterReturning(TransactionAspectSupport.java:375)
        at
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(Tr
ansactionInterceptor.java:120)
        at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Reflect
iveMethodInvocation.java:172)
        at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopPro
xy.java:202)
        at $Proxy17.merge(Unknown Source)
        at
com.shutterfly.sfweb.InsertController.handleRequest(InsertController.java:45
)
        at
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(Si
mpleControllerHandlerAdapter.java:48)
        at
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServl
et.java:771)
        at
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServle
t.java:716)
        at
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkSer
vlet.java:644)
        at
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java
:549)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:290)


My question about the DistributedJDBCStoreManager.flush().  Does it really
have to create a thread pool every single time a row is committed?  Also,
from the profiler it seems like the threads in the pool are not necessarily
used.

Thanks,
Simon

-- 
View this message in context:
http://openjpa.208410.n2.nabble.com/Slice-OutOfMemoryError-shortly-after-pou
nding-1000-threads-to-the-system-tp5000822p5000822.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Mime
View raw message