tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Hansen <joe.hansen...@gmail.com>
Subject Re: java.lang.OutOfMemoryError: Java heap space
Date Thu, 08 Oct 2009 00:40:06 GMT
WoW! "jmap" was a great command to learn Chris! Thank you so much!

I generated a histogram of the Objects in the java heap (while things
were stable) and here's what I got:
Object Histogram:

Size	Count	Class description
-------------------------------------------------------
149989048	3496198	char[]
84708432	3529518	java.lang.String
58308016	560654	tw.beans.TWFotoBean
35620304	179282	byte[]
23286872	30767	int[]
18220184	142094	* ConstMethodKlass
14932056	622169	java.sql.Date
10235120	142094	* MethodKlass
10164784	90757	tw.beans.TWFotoSetBean
8878248	134561	java.lang.Object[]
7949144	16190	* ConstantPoolKlass
6147768	16190	* InstanceKlassKlass
4590176	13997	* ConstantPoolCacheKlass
...
...

As you've pointed out, most of the data is taken by character arrays,
Strings, integer arrays, byte arrays, Foto and FotoSet beans! There
were just 67 Ticket entries (related to CAS) and the size of the
Ticket objects wasn't huge either.

Seeing the histogram results was an eye opener. I am wondering if
Rainer was right all along. Is it just the application data (FotoBean
and FotoSetBean) that's inundating the java heap?

I had changed the session-timeout in server.xml from 30 minutes to 240
minutes. That means an HTTP Session would now last 8 times longer.
Since the Garbage Collector runs only when the session expires, the
application's memory needs are probably increased 8 fold (Am I
right?). And I am storing the FotoBeans and FotoSetBeans in each
user's HTTP Session. As I mentioned before, previously the java heap
was set to the default, 64MB, and it used to be sufficient. From the
time I changed the session-timeout, even 512MB (= 64 X 8) is
insufficient.

Should I just decrease the session-timeout to 2 hours and see if 512MB
is sufficient? Any other thoughts/ideas guys?

Thanks again Chris,
Joe

Here are all the Ticket entries in the heap:
96	4	org.jasig.cas.util.DefaultUniqueTicketIdGenerator
72	3	org.jasig.cas.util.DefaultUniqueTicketIdGenerator
72	3	org.jasig.cas.util.DefaultUniqueTicketIdGenerator
72	3	org.jasig.cas.util.DefaultUniqueTicketIdGenerator
72	3	org.jasig.cas.util.DefaultUniqueTicketIdGenerator
72	3	org.jasig.cas.util.DefaultUniqueTicketIdGenerator
24	1	org.jasig.cas.web.flow.SendTicketGrantingTicketAction
24	1	org.jasig.cas.web.flow.SendTicketGrantingTicketAction
24	1	org.jasig.cas.web.flow.SendTicketGrantingTicketAction
24	1	org.jasig.cas.web.flow.SendTicketGrantingTicketAction
24	1	org.acegisecurity.providers.cas.ticketvalidator.CasProxyTicketValidator
24	1	org.acegisecurity.providers.cas.ticketvalidator.CasProxyTicketValidator
24	1	org.acegisecurity.providers.cas.ticketvalidator.CasProxyTicketValidator
24	1	org.acegisecurity.providers.cas.ticketvalidator.CasProxyTicketValidator
24	1	org.jasig.cas.web.flow.SendTicketGrantingTicketAction
24	1	org.acegisecurity.providers.cas.ticketvalidator.CasProxyTicketValidator
24	1	org.jasig.cas.web.flow.SendTicketGrantingTicketAction
24	1	org.acegisecurity.providers.cas.ticketvalidator.CasProxyTicketValidator
16	1	org.jasig.cas.util.SamlCompliantUniqueTicketIdGenerator
16	1	org.jasig.cas.ticket.registry.DefaultTicketRegistry
16	1	org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner
16	1	org.jasig.cas.util.SamlCompliantUniqueTicketIdGenerator
16	1	org.jasig.cas.ticket.registry.DefaultTicketRegistry
16	1	org.acegisecurity.providers.cas.proxy.RejectProxyTickets
16	1	org.jasig.cas.web.flow.GenerateServiceTicketAction
16	1	org.jasig.cas.ticket.registry.DefaultTicketRegistry
16	1	org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner
16	1	org.acegisecurity.providers.cas.proxy.RejectProxyTickets
16	1	org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner
16	1	org.jasig.cas.web.flow.GenerateServiceTicketAction
16	1	org.jasig.cas.util.SamlCompliantUniqueTicketIdGenerator
16	1	org.acegisecurity.providers.cas.cache.EhCacheBasedTicketCache
16	1	org.acegisecurity.providers.cas.cache.EhCacheBasedTicketCache
16	1	org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner
16	1	org.jasig.cas.util.SamlCompliantUniqueTicketIdGenerator
16	1	org.jasig.cas.web.flow.GenerateServiceTicketAction
16	1	org.acegisecurity.providers.cas.proxy.RejectProxyTickets
16	1	org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner
16	1	org.jasig.cas.web.flow.GenerateServiceTicketAction
16	1	org.acegisecurity.providers.cas.proxy.RejectProxyTickets
16	1	org.jasig.cas.ticket.registry.DefaultTicketRegistry
16	1	org.jasig.cas.ticket.registry.DefaultTicketRegistry
16	1	org.jasig.cas.ticket.registry.DefaultTicketRegistry
16	1	org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner
16	1	org.acegisecurity.providers.cas.cache.EhCacheBasedTicketCache
16	1	org.acegisecurity.providers.cas.cache.EhCacheBasedTicketCache
16	1	org.jasig.cas.util.SamlCompliantUniqueTicketIdGenerator
16	1	org.acegisecurity.providers.cas.cache.EhCacheBasedTicketCache
16	1	org.acegisecurity.providers.cas.proxy.RejectProxyTickets
16	1	org.acegisecurity.providers.cas.cache.EhCacheBasedTicketCache
16	1	org.jasig.cas.util.SamlCompliantUniqueTicketIdGenerator
16	1	org.jasig.cas.web.flow.GenerateServiceTicketAction
16	1	org.jasig.cas.web.flow.GenerateServiceTicketAction
16	1	org.acegisecurity.providers.cas.proxy.RejectProxyTickets

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message