Out of memory issue

723 views
Skip to first unread message

Ankur Jain

unread,
Aug 17, 2010, 11:09:17 PM8/17/10
to javamelody, ankur...@barcap.com
Hi, After my server starts without java melody all run fines,

But after dropping the jars of java melody.
I am getting this exception

Exception in thread "javamelody SMP" java.lang.OutOfMemoryError: Java
heap space
at
java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:
99)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:
393)
at java.lang.StringBuilder.append(StringBuilder.java:120)
at
net.bull.javamelody.MemoryInformations.buildMemoryDetails(MemoryInformations.java:
112)
at
net.bull.javamelody.MemoryInformations.<init>(MemoryInformations.java:
84)
at net.bull.javamelody.JavaInformations.<init>(JavaInformations.java:
134)
at
net.bull.javamelody.Collector.collectLocalContextWithoutErrors(Collector.java:
215)
at net.bull.javamelody.MonitoringFilter
$CollectTimerTask.run(MonitoringFilter.java:81)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)

Emeric Vernat

unread,
Aug 18, 2010, 12:07:34 AM8/18/10
to javam...@googlegroups.com, ankur...@barcap.com
Hi Ankur,

Can you explain a bit more:
Which application server and version? Which JDK and version? Which OS
and version?
Which version of javamelody? with the grails / hudson / jira /
confluence / bamboo plugins?

What is the maximum heap space in this instance? (the Xmx value, which
is also displayed in the system informations part of the javamelody report)
Have you looked at the memory histogram available with a link in the
report? (systems actions need to be enabled to have this feature, and
they can be enabled with the javamelody parameter
system-actions-enabled). If you can give the first 10 or 20 lines of the
memory histogram, it would be great.
When does it occur? (immediately after start, after a few days...)

bye, Emeric


Le 18/08/2010 05:09, Ankur Jain a �crit :

Ankur Jain

unread,
Aug 18, 2010, 1:06:17 AM8/18/10
to javamelody
Server: Apache Tomcat
-server -Xms250m -Xmx600m -XX:MaxPermSize=600m

JDK: 1.5

Javamelody version: 1.18 --> its plugged in my application, I am
using your jar


The error occurs after 1hr of application start.


I had not set any optional parameter

And also I didnt got the link for report in any of the memory
histogram.
> > net.bull.javamelody.MemoryInformations.buildMemoryDetails(MemoryInformation­s.java:
> > 112)
> >    at
> > net.bull.javamelody.MemoryInformations.<init>(MemoryInformations.java:
> > 84)
> >    at net.bull.javamelody.JavaInformations.<init>(JavaInformations.java:
> > 134)
> >    at
> > net.bull.javamelody.Collector.collectLocalContextWithoutErrors(Collector.ja­va:
> > 215)
> >    at net.bull.javamelody.MonitoringFilter
> > $CollectTimerTask.run(MonitoringFilter.java:81)
> >    at java.util.TimerThread.mainLoop(Timer.java:512)
> >    at java.util.TimerThread.run(Timer.java:462)- Hide quoted text -
>
> - Show quoted text -

Emeric Vernat

unread,
Aug 18, 2010, 6:21:22 PM8/18/10
to javam...@googlegroups.com
Hi,

Since you are using tomcat, you only need to add the following line in
your tomcat context and to restart the server, in order to enable system
actions:
<Parameter name='javamelody.system-actions-enabled' value='true'
override='false'/>

Can you add the parameter and click the "Memory histogram" link in the
report, in order to give the first 10 or 20 lines? (you will need to use
a JDK and not a JRE for tomcat in order to have the memory histogram)

More help on parameters is in
http://code.google.com/p/javamelody/wiki/UserGuide#6._Optional_parameters
And for information, the memory histogram is a list giving the number of
live instances per class, and it can also be seen with VisualVM or with
"jmap -histo".
It is a good idea to call the garbage collector before reading the
memory histogram.

bye, Emeric


Le 18/08/2010 07:06, Ankur Jain a �crit :

Ankur...@barclayscapital.com

unread,
Aug 18, 2010, 1:02:54 AM8/18/10
to eve...@free.fr, javam...@googlegroups.com
Server: Apache Tomcat
-server -Xms250m -Xmx600m -XX:MaxPermSize=600m

JDK: 1.5

Javamelody version: 1.18 --> its plugged in my application, I am using your jar


The error occurs after 1hr of application start.

I had attached the javamelody folder I got from my tomcat temp folder

And I had also not used any optional parameter


Regards,
Ankur Jain
Barclays Capital Services Limited
60B Republic Plaza #17-00, Singapore 238891
+65 6828 4271
ankur...@barclayscapital.com

-----Original Message-----
From: Emeric Vernat [mailto:eve...@free.fr]
Sent: Wednesday, August 18, 2010 12:08 PM
To: javam...@googlegroups.com
Cc: Jain, Ankur: IT (SGP)
Subject: Re: [javamelody] Out of memory issue

Hi Ankur,

Can you explain a bit more:
Which application server and version? Which JDK and version? Which OS
and version?
Which version of javamelody? with the grails / hudson / jira /
confluence / bamboo plugins?

What is the maximum heap space in this instance? (the Xmx value, which
is also displayed in the system informations part of the javamelody report)
Have you looked at the memory histogram available with a link in the
report? (systems actions need to be enabled to have this feature, and
they can be enabled with the javamelody parameter
system-actions-enabled). If you can give the first 10 or 20 lines of the
memory histogram, it would be great.
When does it occur? (immediately after start, after a few days...)

bye, Emeric

javamelody.zip

Ankur Jain

unread,
Aug 19, 2010, 10:47:08 PM8/19/10
to javamelody
@Emrik I had attached javamelody folder itself for your reference, it
seems that it is not creating memory histogram,
I had also added the parameter suggested by you, and it is still
giving me error..


On Aug 18, 1:02 pm, <Ankur.J...@barclayscapital.com> wrote:
> Server: Apache Tomcat
> -server -Xms250m -Xmx600m -XX:MaxPermSize=600m
>
> JDK: 1.5
>
> Javamelody version: 1.18  --> its plugged in my application, I am using your jar
>
> The error occurs after 1hr of application start.
>
> I had attached the javamelody folder I got from my tomcat temp folder
>
> And I had also not used any optional parameter
>
> Regards,
> Ankur Jain
> Barclays Capital Services Limited
> 60B Republic Plaza #17-00, Singapore 238891
> +65 6828 4271
> ankur.j...@barclayscapital.com
> > net.bull.javamelody.MemoryInformations.buildMemoryDetails(MemoryInformation­s.java:
> > 112)
> >    at
> > net.bull.javamelody.MemoryInformations.<init>(MemoryInformations.java:
> > 84)
> >    at net.bull.javamelody.JavaInformations.<init>(JavaInformations.java:
> > 134)
> >    at
> > net.bull.javamelody.Collector.collectLocalContextWithoutErrors(Collector.ja­va:
> > 215)
> >    at net.bull.javamelody.MonitoringFilter
> > $CollectTimerTask.run(MonitoringFilter.java:81)
> >    at java.util.TimerThread.mainLoop(Timer.java:512)
> >    at java.util.TimerThread.run(Timer.java:462)
>
>
>
>  javamelody.zip
> 65KViewDownload- Hide quoted text -

Emeric Vernat

unread,
Aug 20, 2010, 4:05:30 PM8/20/10
to javam...@googlegroups.com
Hi,

You have very few data in the javamelody files.
And you should first check your logs for the "org.quartz.core" category:
you had OutOfMemoryErrors at 8/17/10 12:42:10 PM, 8/18/10 3:37:23 AM and
8/18/10 4:54:08 AM, for the sql requests from getServicesCachedData and
from getContacts. It is a problem in your application.

You could also check the used memory in your OS and the RAM available in
your OS.

And it will not change anything, but you can probably divide your
MaxPermSize by 5.

bye, Emeric


Le 18/08/2010 07:02, Ankur...@barclayscapital.com a �crit :

> Le 18/08/2010 05:09, Ankur Jain a �crit :

Ankur Jain

unread,
Aug 24, 2010, 9:58:41 PM8/24/10
to javamelody
Thanks Emeric,

I checked my code, and it is actually problem with the my code only.
But somehow the code was running good before javamelody integration,
But after we integrate it with javamelody, it started to throw error.
When I checked logs, I found the exception told you earlier, so i
concluded that it may be javamelody problem,
But finally I get to know its my own code problem.

And yes the problem was with getContacts. just for info to highlight
that javamelody helped me to findout the problem.



On Aug 21, 4:05 am, Emeric Vernat <ever...@free.fr> wrote:
>   Hi,
>
> You have very few data in the javamelody files.
> And you should first check your logs for the "org.quartz.core" category:
> you had OutOfMemoryErrors at 8/17/10 12:42:10 PM, 8/18/10 3:37:23 AM and
> 8/18/10 4:54:08 AM, for the sql requests from getServicesCachedData and
> from getContacts. It is a problem in your application.
>
> You could also check the used memory in your OS and the RAM available in
> your OS.
>
> And it will not change anything, but you can probably divide your
> MaxPermSize by 5.
>
> bye, Emeric
>
> Le 18/08/2010 07:02, Ankur.J...@barclayscapital.com a crit :
>
>
>
> > Server: Apache Tomcat
> > -server -Xms250m -Xmx600m -XX:MaxPermSize=600m
>
> > JDK: 1.5
>
> > Javamelody version: 1.18  -->  its plugged in my application, I am using your jar
>
> > The error occurs after 1hr of application start.
>
> > I had attached the javamelody folder I got from my tomcat temp folder
>
> > And I had also not used any optional parameter
>
> > Regards,
> > Ankur Jain
> > Barclays Capital Services Limited
> > 60B Republic Plaza #17-00, Singapore 238891
> > +65 6828 4271
> > ankur.j...@barclayscapital.com
> >> net.bull.javamelody.MemoryInformations.buildMemoryDetails(MemoryInformation­s.java:
> >> 112)
> >>        at
> >> net.bull.javamelody.MemoryInformations.<init>(MemoryInformations.java:
> >> 84)
> >>        at net.bull.javamelody.JavaInformations.<init>(JavaInformations.java:
> >> 134)
> >>        at
> >> net.bull.javamelody.Collector.collectLocalContextWithoutErrors(Collector.ja­va:
> >> 215)
> >>        at net.bull.javamelody.MonitoringFilter
> >> $CollectTimerTask.run(MonitoringFilter.java:81)
> >>        at java.util.TimerThread.mainLoop(Timer.java:512)
> >>        at java.util.TimerThread.run(Timer.java:462)- Hide quoted text -

Emeric Vernat

unread,
Aug 25, 2010, 2:26:10 AM8/25/10
to javam...@googlegroups.com
Thanks for the info, Ankur.

bye, Emeric


Le 25/08/2010 03:58, Ankur Jain a �crit :

Reply all
Reply to author
Forward
0 new messages