Fórum

java.lang.OutOfMemoryError: Java heap space

thumbnail
devaraj s, modificado 10 Anos atrás.

java.lang.OutOfMemoryError: Java heap space

Regular Member Postagens: 228 Data de Entrada: 21/05/12 Postagens Recentes
All,
We are running liferay 6.1 ce ga2 in existing jboss 7 server (www.xxx.com) and we have other webapplication in the same jboss server (www.xxx.com/appname).

We have running these two application since from long days back. it was working fine. Now its throwing outofmemory error.

here is my JAVA_OPTS configuration
set "JAVA_OPTS=%JAVA_OPTS% -Xms512M -Xmx1024M -XX : PermSize=256M -XX:MaxPermSize=512M"


I have not set file encoding, prefered protocol stack in JAVA_OPTS , I hope obsence of these paratmeters in JAVA_OPTS does not related to outofmemeory error.

here is my full stack trace

ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/].[Friendly URL Servlet - Public]] (http--0.0.0.0-80-24) Servlet.service() for servlet Friendly URL Servlet - Public threw exception: java.lang.OutOfMemoryError: Java heap space



2013-05-08 16:18:04,145 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/].[jsp]] (http--0.0.0.0-80-13) Servlet.service() for servlet jsp threw exception: java.lang.OutOfMemoryError: Java heap space



2013-05-08 16:17:19,497 ERROR [org.apache.coyote.http11.Http11Protocol] (http--0.0.0.0-80-43) Error reading request, ignored: java.lang.OutOfMemoryError: Java heap space



2013-05-08 16:06:23,790 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/].[jsp]] (http--0.0.0.0-80-2) Servlet.service() for servlet jsp threw exception: java.lang.OutOfMemoryError: Java heap space

	at java.lang.AbstractStringBuilder.<init>(AbstractStringBuilder.java:64) [rt.jar:1.7.0_05]

	at java.lang.StringBuffer.<init>(StringBuffer.java:108) [rt.jar:1.7.0_05]

	at com.ctc.wstx.util.TextBuffer.contentsAsString(TextBuffer.java:393) [wstx.jar:3.2.4]

	at com.ctc.wstx.sr.BasicStreamReader.getText(BasicStreamReader.java:821) [wstx.jar:3.2.4]

	at com.ctc.wstx.evt.DefaultEventAllocator.allocate(DefaultEventAllocator.java:138) [wstx.jar:3.2.4]

	at com.ctc.wstx.evt.WstxEventReader.createNextEvent(WstxEventReader.java:347) [wstx.jar:3.2.4]

	at com.ctc.wstx.evt.WstxEventReader.peek(WstxEventReader.java:306) [wstx.jar:3.2.4]

	at com.liferay.portal.xml.StAXReaderUtil.read(StAXReaderUtil.java:37) [portal-impl.jar:]

	at com.liferay.portlet.PortletPreferencesFactoryImpl.readPreference(PortletPreferencesFactoryImpl.java:619) [portal-impl.jar:]

	at com.liferay.portlet.PortletPreferencesFactoryImpl.populateMap(PortletPreferencesFactoryImpl.java:579) [portal-impl.jar:]

	at com.liferay.portlet.PortletPreferencesFactoryImpl.fromXML(PortletPreferencesFactoryImpl.java:95) [portal-impl.jar:]

	at com.liferay.portlet.PortletPreferencesFactoryImpl.fromXML(PortletPreferencesFactoryImpl.java:1) [portal-impl.jar:]

	at com.liferay.portlet.PortletPreferencesFactoryUtil.fromXML(PortletPreferencesFactoryUtil.java:49) [portal-service.jar:]

	at com.liferay.portal.service.impl.PortletPreferencesLocalServiceImpl.doGetPreferences(PortletPreferencesLocalServiceImpl.java:334) [portal-impl.jar:]

	at com.liferay.portal.service.impl.PortletPreferencesLocalServiceImpl.getPreferences(PortletPreferencesLocalServiceImpl.java:193) [portal-impl.jar:]

	at com.liferay.portal.service.impl.PortletPreferencesLocalServiceImpl.getPreferences(PortletPreferencesLocalServiceImpl.java:179) [portal-impl.jar:]

	at sun.reflect.GeneratedMethodAccessor195.invoke(Unknown Source) [:1.7.0_05]

	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_05]

	at java.lang.reflect.Method.invoke(Method.java:601) [rt.jar:1.7.0_05]

	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:122) [portal-impl.jar:]

	at com.liferay.portal.service.impl.PortletPreferencesLocalServiceStagingAdvice.getPreferences(PortletPreferencesLocalServiceStagingAdvice.java:135) [portal-impl.jar:]

	at com.liferay.portal.service.impl.PortletPreferencesLocalServiceStagingAdvice.invoke(PortletPreferencesLocalServiceStagingAdvice.java:65) [portal-impl.jar:]

	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118) [portal-impl.jar:]

	at com.liferay.portal.spring.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:71) [portal-impl.jar:]

	at com.liferay.portal.spring.aop.ServiceBeanMethodInvocation.proceed(ServiceBeanMethodInvocation.java:118) [portal-impl.jar:]

	at com.liferay.portal.spring.aop.ServiceBeanAopProxy.invoke(ServiceBeanAopProxy.java:211) [portal-impl.jar:]

	at $Proxy159.getPreferences(Unknown Source)	at com.liferay.portal.service.PortletPreferencesLocalServiceUtil.getPreferences(PortletPreferencesLocalServiceUtil.java:349) [portal-service.jar:]

	at com.liferay.portlet.PortletPreferencesFactoryImpl.getLayoutPortletSetup(PortletPreferencesFactoryImpl.java:131) [portal-impl.jar:]

	at com.liferay.portlet.PortletPreferencesFactoryUtil.getLayoutPortletSetup(PortletPreferencesFactoryUtil.java:65) [portal-service.jar:]

	at com.liferay.portal.util.PortalImpl.getScopeGroupId(PortalImpl.java:3704) [portal-impl.jar:]

	at com.liferay.portal.util.PortalImpl.getScopeGroupId(PortalImpl.java:3674) [portal-impl.jar:]



2013-05-08 16:10:57,530 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/].[Main Servlet]] (http--0.0.0.0-80-1) Servlet.service() for servlet Main Servlet threw exception: java.lang.OutOfMemoryError: Java heap space



2013-05-08 16:12:10,712 ERROR [stderr] (liferay/scheduler_dispatch-232) 	at com.liferay.portal.kernel.concurrent.ThreadPoolExecutor$WorkerTask.run(ThreadPoolExecutor.java:573)



2013-05-08 16:12:36,210 ERROR [org.apache.coyote.http11.Http11Processor] (http--0.0.0.0-80-36) Error processing request: java.lang.OutOfMemoryError: Java heap space



2013-05-08 16:14:07,220 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/].[jsp]] (http--0.0.0.0-80-20) Servlet.service() for servlet jsp threw exception: java.lang.OutOfMemoryError: Java heap space
</init></init>


please anyone suggest me what is the issue here.

Thanks in advance.
ramakanth reddy, modificado 10 Anos atrás.

RE: java.lang.OutOfMemoryError: Java heap space

Junior Member Postagens: 27 Data de Entrada: 17/04/13 Postagens Recentes
Hi

Add JAVA_OPTS in your system variable with following options:

Steps in windows7:

Right click on Mycomputer--> Advanced System settings -->environment variables -- > under system variable add the following

variable name:JAVA_OPTS
variable value: -Xms256M -Xmx512M
Thanks,
Ramakanth
thumbnail
devaraj s, modificado 10 Anos atrás.

RE: java.lang.OutOfMemoryError: Java heap space

Regular Member Postagens: 228 Data de Entrada: 21/05/12 Postagens Recentes
ramakanth reddy:
Hi

Add JAVA_OPTS in your system variable with following options:

Steps in windows7:

Right click on Mycomputer--> Advanced System settings -->environment variables -- > under system variable add the following

variable name:JAVA_OPTS
variable value: -Xms256M -Xmx512M
Thanks,
Ramakanth


Hi , Thanks for response.

I followed your suggestion but no useful , I think there is some other issue.
karthik reddy, modificado 10 Anos atrás.

java.lang.OutOfMemoryError: Java heap space

Junior Member Postagens: 60 Data de Entrada: 08/04/13 Postagens Recentes
It is possible to increase heap size allocated by the JVM by using command line options Here we have 3 options
-Xms<size> set initial Java heap size
-Xmx<size> set maximum Java heap size
-Xss<size> set java thread stack size
java -Xms16m -Xmx64m ClassName

In server
java -Xms16m -Xmx64m ClassName
Open the server tab in eclipse
right click open
click on open lauch configuration
Go to arguments
Here you can add in VM arguments after endorsed
-Xms64m -Xmx256m

It is possible to increase heap size allocated by the JVM in eclipse directly In eclipse IDE goto
Run---->Run Configurations---->Arguments
Enter -Xmx1g(It is used to set the max size like Xmx256m or Xmx1g...... m-->mb g--->gb)
In JBoss
You can set it as JVM arguments the usual way, e.g. -Xms1024m -Xmx2048m for a minimum heap of 1GB and maximum heap of 2GB. JBoss will use the JAVA_OPTS environment variable to include additional JVM arguments, you could specify it in the /bin/run.conf.bat file:
set "JAVA_OPTS=%JAVA_OPTS% -Xms1024m -Xmx2048m"

Thanks & Regards
M.Karthik Reddy
thumbnail
Vishal Panchal, modificado 7 Anos atrás.

RE: java.lang.OutOfMemoryError: Java heap space

Expert Postagens: 289 Data de Entrada: 20/05/12 Postagens Recentes
Dear Devraj,

I am having same environment setup and also facing the same errors.
Please share in case you have got solution to this error.

Thanks,
Vishal
ramakanth reddy, modificado 10 Anos atrás.

RE: java.lang.OutOfMemoryError: Java heap space

Junior Member Postagens: 27 Data de Entrada: 17/04/13 Postagens Recentes
Could you please check by increasing heap size from 512 to 1024 and verify once
Jim Terry, modificado 4 Anos atrás.

RE: java.lang.OutOfMemoryError: Java heap space

New Member Mensagem: 1 Data de Entrada: 27/05/19 Postagens Recentes
Informative article. Heap Hero, a universal tool that will parse and analyze heaps dumps written in any language that runs on the JVM. It will convert Java, Scala, Jython, JRuby heap dumps to useful information to optimize your memory usage.