File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes OutOfMemoryError while Retrieving data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "OutOfMemoryError while Retrieving data " Watch "OutOfMemoryError while Retrieving data " New topic
Author

OutOfMemoryError while Retrieving data

Anand Arasu
Greenhorn

Joined: Jun 08, 2005
Posts: 5
Hi All,

Situation:
--------------
We are loading the page text(Text to be displayed in HTML) from database and the Init Servlet has the code for retrieving the text. Hence while publishing the ear file, the data are prepopulated to the JVM and based on request the page text are displayed.

System Details :
--------------------
Database - Oracle 10G
IDE - RAD 6.0
jdk - 1.4
Ram - 1 GB
OS - Win XP

And the table has 2 varchar2 and 3 Clob datatypes..

Problem:
---------
But when we try to publish it twice or thrice it gives the OutOfMemoryError and gives the below Exception.


[10/26/06 19:25:22:187 IST] 0000009e ServletWrappe E SRVE0100E: Did not realize init() exception thrown by servlet InitServerServlet: java.lang.OutOfMemoryError
at oracle.jdbc.driver.T4C8TTIClob.read(T4C8TTIClob.java(Compiled Code))
at oracle.jdbc.driver.T4CConnection.getChars(T4CConnection.java(Compiled Code))
at oracle.sql.CLOB.getChars(CLOB.java(Inlined Compiled Code))
at oracle.jdbc.driver.OracleClobReader.needChars(OracleClobReader.java(Compiled Code))
at oracle.jdbc.driver.OracleClobReader.read(OracleClobReader.java(Compiled Code))
at java.io.Reader.read(Reader.java(Inlined Compiled Code))
at oracle.jdbc.driver.ClobAccessor.getString(ClobAccessor.java(Compiled Code))
at oracle.jdbc.driver.T4CClobAccessor.getString(T4CClobAccessor.java(Compiled Code))
at oracle.jdbc.driver.OracleResultSetImpl.getString(OracleResultSetImpl.java(Compiled Code))
at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java(Compiled Code))
at com.ibm.ws.rsadapter.jdbc.WSJdbcResultSet.getString(WSJdbcResultSet.java(Compiled Code))
at com.aaaa.aaaaa.Language.getText(LookupDAO.java:106)
at com.aaaaa.aaaaa.LookupDBLayer.getText(LanguageLookupDBLayer.java:41)
at com.aaaaa.aaaaa.LookupBundle.loadBundle(LanguageLookupBundle.java:28)
at com.aaaaa.aaaaa.existingmerchant.jsf.utils.InitServerServlet.initLanguageData(InitServerServlet.java:77)
at com.aaaaa.aaaaa.existingmerchant.jsf.utils.InitServerServlet.init(InitServerServlet.java:34)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:262)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:1319)
at com.ibm.wsspi.webcontainer.extension.WebExtensionProcessor.createServletWrapper(WebExtensionProcessor.java:84)
at com.ibm.ws.webcontainer.webapp.WebApp.getServletWrapper(WebApp.java:745)
at com.ibm.ws.webcontainer.webapp.WebApp.initializeTargetMappings(WebApp.java:493)
at com.ibm.ws.webcontainer.webapp.WebApp.initialize(WebApp.java:379)
at com.ibm.ws.webcontainer.webapp.WebGroup.addWebApplication(WebGroup.java:114)
at com.ibm.ws.webcontainer.VirtualHost.addWebApplication(VirtualHost.java:127)
at com.ibm.ws.webcontainer.WebContainer.addWebApp(WebContainer.java:776)
at com.ibm.ws.webcontainer.WebContainer.addWebApplication(WebContainer.java:729)
at com.ibm.ws.runtime.component.WebContainerImpl.install(WebContainerImpl.java:140)
at com.ibm.ws.runtime.component.WebContainerImpl.start(WebContainerImpl.java:360)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1019)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1028)
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:538)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:724)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:683)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:1161)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java(Compiled Code))
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at javax.management.modelmbean.RequiredModelMBean.invokeMethod(RequiredModelMBean.java:1366)
at javax.management.modelmbean.RequiredModelMBean.invoke(RequiredModelMBean.java:1012)
at mx4j.server.interceptor.InvokerMBeanServerInterceptor.invoke(InvokerMBeanServerInterceptor.java:233)
at mx4j.server.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:128)
at mx4j.server.interceptor.SecurityMBeanServerInterceptor.invoke(SecurityMBeanServerInterceptor.java:86)
at mx4j.server.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:128)
at mx4j.server.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:128)
at mx4j.server.interceptor.ContextClassLoaderMBeanServerInterceptor.invoke(ContextClassLoaderMBeanServerInterceptor.java:167)
at mx4j.server.MX4JMBeanServer.invoke(MX4JMBeanServer.java:1249)
at com.ibm.ws.management.AdminServiceImpl$1.run(AdminServiceImpl.java:901)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java(Compiled Code))
at com.ibm.ws.management.AdminServiceImpl.invoke(AdminServiceImpl.java:817)
at com.ibm.ws.management.application.sync.StartDeploymentTask.startDeployment(StartDeploymentTask.java:196)
at com.ibm.ws.management.application.sync.StartDeploymentTask.fullAppUpdate(StartDeploymentTask.java:92)
at com.ibm.ws.management.application.sync.StartDeploymentTask.performTask(StartDeploymentTask.java:81)
at com.ibm.ws.management.application.sync.AppBinaryProcessor$AppBinThread.run(AppBinaryProcessor.java:631)
at com.ibm.ws.management.application.sync.AppBinaryProcessor.postProcess(AppBinaryProcessor.java:408)
at com.ibm.ws.management.application.sync.AppBinaryProcessor._onChangeCompletion(AppBinaryProcessor.java:330)
at com.ibm.ws.management.application.sync.AppBinaryProcessor$2.run(AppBinaryProcessor.java:302)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java(Compiled Code))
at com.ibm.ws.management.application.sync.AppBinaryProcessor.onChangeCompletion(AppBinaryProcessor.java:296)
at com.ibm.ws.management.repository.FileRepository.postNotify(FileRepository.java:1653)
at com.ibm.ws.management.repository.FileRepository.update(FileRepository.java:1211)
at com.ibm.ws.management.repository.client.LocalConfigRepositoryClient.update(LocalConfigRepositoryClient.java:189)
at com.ibm.ws.sm.workspace.impl.WorkSpaceMasterRepositoryAdapter.update(WorkSpaceMasterRepositoryAdapter.java:482)
at com.ibm.ws.sm.workspace.impl.RepositoryContextImpl.update(RepositoryContextImpl.java:1730)
at com.ibm.ws.sm.workspace.impl.RepositoryContextImpl.synch(RepositoryContextImpl.java:1676)
at com.ibm.ws.sm.workspace.impl.WorkSpaceImpl.synch(WorkSpaceImpl.java:455)
at com.ibm.ws.management.application.task.ConfigRepoHelper.removeWorkSpace(ConfigRepoHelper.java:107)
at com.ibm.ws.management.application.RedeploymentManager.doCleanup(RedeploymentManager.java:243)
at com.ibm.ws.management.application.RedeploymentManager.appEventReceived(RedeploymentManager.java:187)
at com.ibm.ws.management.application.RedeploymentManager.handleNotification(RedeploymentManager.java:210)
at com.ibm.ws.management.event.ListenerInfo$1.run(ListenerInfo.java:125)
at com.ibm.ws.security.auth.distContextManagerImpl.runAs(distContextManagerImpl.java:2504)
at com.ibm.ws.security.auth.distContextManagerImpl.runAsSpecified(distContextManagerImpl.java:2398)
at com.ibm.ws.management.event.ListenerInfo.handleNotification(ListenerInfo.java:143)
at com.ibm.ws.management.event.NotificationDispatcher$DispatchANotificationToAListener.run(NotificationDispatcher.java(Compiled Code))
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1332)

Kindly let me know if i could have a work around for this....

Thanks and Regards,
Anand
Scott Johnson
Ranch Hand

Joined: Aug 24, 2005
Posts: 518
Deploy your ear a couple of times and then take a heap dump and look for objects that are not getting released.

You may find this article informative.
Anand Arasu
Greenhorn

Joined: Jun 08, 2005
Posts: 5
Yes. Tried doing it. But it gives an Exception immediately once its published. Also was wondering anything related to usage of Clob datatype.
While retrieving, am using resultset.getClob method.. Is that anything related to that?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: OutOfMemoryError while Retrieving data