Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Out of Memory/ Command.process

 
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi. I am receiving an Out of Memory error when trying to access any forum Category. There are roughly 1000 messages in the system. We are using HSQLDB as the db backend.

JForum version is: 2.1.4

I have attempted to run Tomcat with increasing amounts of Heap space, however it uses it all and pegs the processor at 99% use.

This is the Exception we are seeing:

<!-- BEGIN ERROR STACK TRACE <br /> java.lang.reflect.InvocationTargetException <br /> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) <br /> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) <br /> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) <br /> at java.lang.reflect.Method.invoke(Method.java:585) <br /> at net.jforum.Command.process(Command.java:106) <br /> at net.jforum.JForum.service(JForum.java:298) <br /> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802) <br /> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237) <br /> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157) <br /> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214) <br /> at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) <br /> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) <br /> at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198) <br /> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152) <br /> at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) <br /> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) <br /> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137) <br /> at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) <br /> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118) <br /> at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102) <br /> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) <br /> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) <br /> at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104) <br /> at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520) <br /> at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929) <br /> at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160) <br /> at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300) <br /> at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374) <br /> at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743) <br /> at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675) <br /> at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866) <br /> at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683) <br /> at java.lang.Thread.run(Thread.java:595) <br /> Caused by: java.lang.OutOfMemoryError: Java heap space <br /> <br /> <br /> Any help would be appreciated. <br /> <br /> <br /> Thanks. <br /> <br /> T. <br /> [originally posted on jforum.net by tbos]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
update:

I picked up the source, and tracked down the actual location of the problem.
It was in processSmilies, the admin had created 5 smilies without names, but the images where there.
[originally posted on jforum.net by Anonymous]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmm... are you able to reproduce the bug? Also, are you sure it is not happening because of a small tomcat heap?

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have not attempted to re-produce it yet, I will give it a try tonight.
During debugging, I ran Tomcat with various heap settings. My last attempt was to give it 1024M on a server with 2GB. It used it all, and then ran out of memory. Is there some recursion happening in processSmilies?

T.
[originally posted on jforum.net by tbos]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think processSmilies() should be the root of the problem.

Well, 1GB heap is big... Why don't you try version 2.1.5? Get the pre-release from http://www.jforum.net/upload/JForum-2.1.5.zip

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, 1GB is big. Once I gave the smilies names, it ran fine, and only uses about 70MB.

Here is the iterator loop from processSmilies in PostCommon.java


When run with the bogus smilies, it would print out this repeatedly:
testing smilie:
smilie exists!:
testing smilie:
smilie exists!:
testing smilie:
smilie exists!:
testing smilie:
smilie exists!:
testing smilie:
smilie exists!:


Getting slower and slower between each testing/exists..


I will give 2.1.5 a try. Thanks for your help.

T.
[originally posted on jforum.net by tbos]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, once of forum admins added serveral smilies, but somehow was able leave the name blank.

There are even stranger things happening today though:

Caused by: java.sql.SQLException: S1000 General error java.lang.NegativeArraySizeException in statement [UPDATE jforum_topics SET topic_views = topic_views + 1 WHERE topic_id = ?]
at org.hsqldb.jdbc.Util.throwError(Unknown Source)
at org.hsqldb.jdbc.jdbcPreparedStatement.executeUpdate(Unknown Source)
at net.jforum.drivers.generic.TopicModel.incrementTotalViews(TopicModel.java:246)
at net.jforum.view.forum.PostAction.list(PostAction.java:145)
... 37 more


AND

Caused by: java.sql.SQLException: S1000 General error java.lang.IndexOutOfBoundsException in statement [SELECT session_time, session_start, session_id FROM jforum_sessions WHERE session_user_id = ?]
at org.hsqldb.jdbc.Util.throwError(Unknown Source)
at org.hsqldb.jdbc.jdbcPreparedStatement.executeQuery(Unknown Source)
at net.jforum.drivers.generic.UserSessionModel.selectById(UserSessionModel.java:110)
at net.jforum.view.forum.UserAction.validateLogin(UserAction.java:310)
... 38 more

And on login:





very odd.

thanks.

T.
[originally posted on jforum.net by tbos]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hhm... I see

Did you add some new smilies to the forum, or were you running it with the default ones?

This (possible) bug is new to me.

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.

After a little more work, I discovered that all There were NULL's in the jforum_search_words table, and the jforum_search_wordmatch table could not be read at all without throwing an exception.

I dropped and recreated all of the search tables, and the error went away, but now(of course) all of the post indexing is gone.

Is there a wat to regenerate the search hashes from existing posts and topics?

thanks

T.
[originally posted on jforum.net by tbos]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wish I had that tool also. Maybe I will get the time...
[originally posted on jforum.net by time]
 
Migrated From Jforum.net
Ranch Hand
Posts: 17424
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is that tool, yes:

http://jforum-tools.dev.java.net

If you can get it from cvs, please do!

Rafael
[originally posted on jforum.net by Rafael Steil]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic