Re: java.lang.OutOfMemoryError: PermGen space when reopening solr server

2010-09-02 Thread Lance Norskog
Loading a servlet creates a bunch of classes via reflection. These are
in PermGen and never go away. If you loadunload over and over again,
any PermGen setting will fill up.

On Wed, Sep 1, 2010 at 2:23 PM, Luke Tebbs l...@staffing-systems.co.uk wrote:

 Have you tried to up the MaxHeapSize?

 I tend to run solr and the development instance in a separate jetty (on a
 separate port) and actually restart the web server for the dev application
 every now and again.
 It doesn't take too long if you only have one webapp on jetty - I tend to
 use mvn jetty:run on the CLI rather than launch jetty in eclipse. I also use
 JRebel to reduce the number of restarts needed during dev.

 As for a production instance, should you need to redeploy that often?

 Luke

 Antonio Calo' wrote:

  Hi guys

 I'm facing an error in our production environment with our search
 application based on maven with spring + solrj.

 When I try to change a class, or try to redeploy/restart an application, I
 catch a java.lang.OutOfMemoryError: PermGen

 I've tryed to understand the cause of this and also I've succeded in
 reproducing this issue on my local develop environment by just restarting
 the jetty several time (I'm using eclipse + maven plugin).

 The logs obtained are those:

   [...]
   1078 [Timer-1] INFO org.apache.solr.core.RequestHandlers - created
   /admin/: org.apache.solr.handler.admin.AdminHandlers
   1078 [Timer-1] INFO org.apache.solr.core.RequestHandlers - created
   /admin/ping: PingRequestHandler
   1078 [Timer-1] INFO org.apache.solr.core.RequestHandlers - created
   /debug/dump: solr.DumpRequestHandler
   32656 [Finalizer] INFO org.apache.solr.core.SolrCore - []  CLOSING
   SolrCore org.apache.solr.core.solrc...@1409c28
   17:43:19 ERROR InvertedIndexEngine:124 open -
   java.lang.OutOfMemoryError: PermGen space
   java.lang.RuntimeException: java.lang.OutOfMemoryError: PermGen space
        at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1068)
        at org.apache.solr.core.SolrCore.init(SolrCore.java:579)
        at

 org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:137)
        at

 com.intellisemantic.intellifacet.resource.invertedIndex.InvertedIndexEngine.open(InvertedIndexEngine.java:113)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at

 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at

 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at

 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1536)
        at

 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
        at

 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409)
   [...]

 The exception is always thrown while solr init is performed after a
 restart (this is the reason why I'm asking your support ;) )

 It seems that while solr is trying to be set up (by [Timer-1]), another
 thread ([Finalizer]) is trying to close it. I can see from the Solr code
 that this exception is thrown always in the same place: SolrCore.java:1068.
 Here there is a comment that say:

   // need to close the searcher here??? we shouldn't have to.
          throw new RuntimeException(th);
        } finally {
          if (newestSearcher != null) {
            newestSearcher.decref();
          }
        }

 I'm using slorj lib in a Spring container, so I'm supposing that Spring
 will manage the relase of all the singleton classes. Should I do something
 other like force closing solr?

 Thanks in advance for your support.

 Best regards

 Antonio






-- 
Lance Norskog
goks...@gmail.com


Re: java.lang.OutOfMemoryError: PermGen space when reopening solr server

2010-09-02 Thread Peter Karich
Hi,

that issue is not really related to solr. See this:
http://stackoverflow.com/questions/88235/how-to-deal-with-java-lang-outofmemoryerror-permgen-space-error

Increasing maxpermsize -XX:MaxPermSize=128m does not really solve this
issue but you will see less errros :-)

I have written a mini monitor app which I am executing before reloading
to make sure I have enough permgensize.
But you can see the current permgensize usage easily e.g. with jvisualvm.

Regards,
Peter.

  Hi guys

 I'm facing an error in our production environment with our search
 application based on maven with spring + solrj.

 When I try to change a class, or try to redeploy/restart an
 application, I catch a java.lang.OutOfMemoryError: PermGen

 I've tryed to understand the cause of this and also I've succeded in
 reproducing this issue on my local develop environment by just
 restarting the jetty several time (I'm using eclipse + maven plugin).

 The logs obtained are those:

[...]
1078 [Timer-1] INFO org.apache.solr.core.RequestHandlers - created
/admin/: org.apache.solr.handler.admin.AdminHandlers
1078 [Timer-1] INFO org.apache.solr.core.RequestHandlers - created
/admin/ping: PingRequestHandler
1078 [Timer-1] INFO org.apache.solr.core.RequestHandlers - created
/debug/dump: solr.DumpRequestHandler
32656 [Finalizer] INFO org.apache.solr.core.SolrCore - []  CLOSING
SolrCore org.apache.solr.core.solrc...@1409c28
17:43:19 ERROR InvertedIndexEngine:124 open -
java.lang.OutOfMemoryError: PermGen space
java.lang.RuntimeException: java.lang.OutOfMemoryError: PermGen space
 at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1068)
 at org.apache.solr.core.SolrCore.init(SolrCore.java:579)
 at
   
 org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:137)

 at
   
 com.intellisemantic.intellifacet.resource.invertedIndex.InvertedIndexEngine.open(InvertedIndexEngine.java:113)

 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
   
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

 at
   
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

 at java.lang.reflect.Method.invoke(Method.java:597)
 at
   
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1536)

 at
   
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)

 at
   
 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409)

[...]

 The exception is always thrown while solr init is performed after a
 restart (this is the reason why I'm asking your support ;) )

 It seems that while solr is trying to be set up (by [Timer-1]),
 another thread ([Finalizer]) is trying to close it. I can see from the
 Solr code that this exception is thrown always in the same place:
 SolrCore.java:1068.
 Here there is a comment that say:

// need to close the searcher here??? we shouldn't have to.
   throw new RuntimeException(th);
 } finally {
   if (newestSearcher != null) {
 newestSearcher.decref();
   }
 }

 I'm using slorj lib in a Spring container, so I'm supposing that
 Spring will manage the relase of all the singleton classes. Should I
 do something other like force closing solr?

 Thanks in advance for your support.

 Best regards

 Antonio



-- 
http://jetwick.com new twitter search prototype




Re: java.lang.OutOfMemoryError: PermGen space when reopening solr server

2010-09-02 Thread Antonio Calo'

 Il 02/09/2010 8.51, Lance Norskog ha scritto:

Loading a servlet creates a bunch of classes via reflection. These are
in PermGen and never go away. If you loadunload over and over again,
any PermGen setting will fill up.
I agree , taking a look to all the links suggested by Peter seems that 
this exception could be caused by the memory leak. Also, it seems that 
the CGLibe that manage the .class loading used by Spring have a big 
issue about this.


Maibe it is  just an accident that it happens while opening a anew solr 
instance.


I'll investigate about general Permgem fault, but if someone have a 
suggestion on how to close solr server in a safe manner, you are  welcome!


Many thanks for your feedbacks.

Antonio


Re: java.lang.OutOfMemoryError: PermGen space when reopening solr server

2010-09-02 Thread Luke Tebbs

I agree.

I wasn't proposing it as a fix merely as a means to reduce the time 
between restarts.



Luke

Lance Norskog wrote:

Loading a servlet creates a bunch of classes via reflection. These are
in PermGen and never go away. If you loadunload over and over again,
any PermGen setting will fill up.

On Wed, Sep 1, 2010 at 2:23 PM, Luke Tebbs l...@staffing-systems.co.uk wrote:
  

Have you tried to up the MaxHeapSize?

I tend to run solr and the development instance in a separate jetty (on a
separate port) and actually restart the web server for the dev application
every now and again.
It doesn't take too long if you only have one webapp on jetty - I tend to
use mvn jetty:run on the CLI rather than launch jetty in eclipse. I also use
JRebel to reduce the number of restarts needed during dev.

As for a production instance, should you need to redeploy that often?

Luke

Antonio Calo' wrote:


 Hi guys

I'm facing an error in our production environment with our search
application based on maven with spring + solrj.

When I try to change a class, or try to redeploy/restart an application, I
catch a java.lang.OutOfMemoryError: PermGen

I've tryed to understand the cause of this and also I've succeded in
reproducing this issue on my local develop environment by just restarting
the jetty several time (I'm using eclipse + maven plugin).

The logs obtained are those:

  [...]
  1078 [Timer-1] INFO org.apache.solr.core.RequestHandlers - created
  /admin/: org.apache.solr.handler.admin.AdminHandlers
  1078 [Timer-1] INFO org.apache.solr.core.RequestHandlers - created
  /admin/ping: PingRequestHandler
  1078 [Timer-1] INFO org.apache.solr.core.RequestHandlers - created
  /debug/dump: solr.DumpRequestHandler
  32656 [Finalizer] INFO org.apache.solr.core.SolrCore - []  CLOSING
  SolrCore org.apache.solr.core.solrc...@1409c28
  17:43:19 ERROR InvertedIndexEngine:124 open -
  java.lang.OutOfMemoryError: PermGen space
  java.lang.RuntimeException: java.lang.OutOfMemoryError: PermGen space
   at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1068)
   at org.apache.solr.core.SolrCore.init(SolrCore.java:579)
   at

org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:137)
   at

com.intellisemantic.intellifacet.resource.invertedIndex.InvertedIndexEngine.open(InvertedIndexEngine.java:113)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at

sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at

sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1536)
   at

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
   at

org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409)
  [...]

The exception is always thrown while solr init is performed after a
restart (this is the reason why I'm asking your support ;) )

It seems that while solr is trying to be set up (by [Timer-1]), another
thread ([Finalizer]) is trying to close it. I can see from the Solr code
that this exception is thrown always in the same place: SolrCore.java:1068.
Here there is a comment that say:

  // need to close the searcher here??? we shouldn't have to.
 throw new RuntimeException(th);
   } finally {
 if (newestSearcher != null) {
   newestSearcher.decref();
 }
   }

I'm using slorj lib in a Spring container, so I'm supposing that Spring
will manage the relase of all the singleton classes. Should I do something
other like force closing solr?

Thanks in advance for your support.

Best regards

Antonio

  





  




Re: java.lang.OutOfMemoryError: PermGen space when reopening solr server

2010-09-02 Thread Luke Tebbs

Antonio Calo' wrote:

 Il 02/09/2010 8.51, Lance Norskog ha scritto:

Loading a servlet creates a bunch of classes via reflection. These are
in PermGen and never go away. If you loadunload over and over again,
any PermGen setting will fill up.
I agree , taking a look to all the links suggested by Peter seems that 
this exception could be caused by the memory leak. Also, it seems that 
the CGLibe that manage the .class loading used by Spring have a big 
issue about this.
I looked into this about 6 months ago (with regards to this problem 
occurring with tomcat + spring, not jetty + solr) and found quite a bit 
of information on the Spring Community Forums. There was (at the time) 
no conclusive answer - it seemed CGLIB is used by just about everything 
(hibernate, AOP, tomcat, jetty) and that it has this latent defect.
Spring developers were basically saying it is due to CGLIB and there was 
nothing that they were able to do about it.


In the end I switched to jetty (for quicker startup) and just accepted 
restarting after every handful of redeploys.


CGLIB mailing lists (http://cglib.sourceforge.net/mail-lists.html) might 
be a good place to start.


Maibe it is  just an accident that it happens while opening a anew 
solr instance.


I'll investigate about general Permgem fault, but if someone have a 
suggestion on how to close solr server in a safe manner, you are  
welcome!

Many thanks for your feedbacks.

Antonio




java.lang.OutOfMemoryError: PermGen space when reopening solr server

2010-09-01 Thread Antonio Calo'

 Hi guys

I'm facing an error in our production environment with our search 
application based on maven with spring + solrj.


When I try to change a class, or try to redeploy/restart an application, 
I catch a java.lang.OutOfMemoryError: PermGen


I've tryed to understand the cause of this and also I've succeded in 
reproducing this issue on my local develop environment by just 
restarting the jetty several time (I'm using eclipse + maven plugin).


The logs obtained are those:

   [...]
   1078 [Timer-1] INFO org.apache.solr.core.RequestHandlers - created
   /admin/: org.apache.solr.handler.admin.AdminHandlers
   1078 [Timer-1] INFO org.apache.solr.core.RequestHandlers - created
   /admin/ping: PingRequestHandler
   1078 [Timer-1] INFO org.apache.solr.core.RequestHandlers - created
   /debug/dump: solr.DumpRequestHandler
   32656 [Finalizer] INFO org.apache.solr.core.SolrCore - []  CLOSING
   SolrCore org.apache.solr.core.solrc...@1409c28
   17:43:19 ERROR InvertedIndexEngine:124 open -
   java.lang.OutOfMemoryError: PermGen space
   java.lang.RuntimeException: java.lang.OutOfMemoryError: PermGen space
at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1068)
at org.apache.solr.core.SolrCore.init(SolrCore.java:579)
at
   
org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:137)
at
   
com.intellisemantic.intellifacet.resource.invertedIndex.InvertedIndexEngine.open(InvertedIndexEngine.java:113)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
   sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
   
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
   
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1536)
at
   
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
at
   
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409)
   [...]

The exception is always thrown while solr init is performed after a 
restart (this is the reason why I'm asking your support ;) )


It seems that while solr is trying to be set up (by [Timer-1]), another 
thread ([Finalizer]) is trying to close it. I can see from the Solr code 
that this exception is thrown always in the same place: SolrCore.java:1068.

Here there is a comment that say:

   // need to close the searcher here??? we shouldn't have to.
  throw new RuntimeException(th);
} finally {
  if (newestSearcher != null) {
newestSearcher.decref();
  }
}

I'm using slorj lib in a Spring container, so I'm supposing that Spring 
will manage the relase of all the singleton classes. Should I do 
something other like force closing solr?


Thanks in advance for your support.

Best regards

Antonio


java.lang.OutOfMemoryError: PermGen space when reopening solr server

2010-09-01 Thread Antonio Calo'

 Hi guys

I'm facing an error in our production environment with our search 
application based on maven with spring + solrj.


When I try to change a class, or try to redeploy/restart an application, 
I catch a java.lang.OutOfMemoryError: PermGen


I've tryed to understand the cause of this and also I've succeded in 
reproducing this issue on my local develop environment by just 
restarting the jetty several time (I'm using eclipse + maven plugin).


The logs obtained are those:

   [...]
   1078 [Timer-1] INFO org.apache.solr.core.RequestHandlers - created
   /admin/: org.apache.solr.handler.admin.AdminHandlers
   1078 [Timer-1] INFO org.apache.solr.core.RequestHandlers - created
   /admin/ping: PingRequestHandler
   1078 [Timer-1] INFO org.apache.solr.core.RequestHandlers - created
   /debug/dump: solr.DumpRequestHandler
   32656 [Finalizer] INFO org.apache.solr.core.SolrCore - []  CLOSING
   SolrCore org.apache.solr.core.solrc...@1409c28
   17:43:19 ERROR InvertedIndexEngine:124 open -
   java.lang.OutOfMemoryError: PermGen space
   java.lang.RuntimeException: java.lang.OutOfMemoryError: PermGen space
at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1068)
at org.apache.solr.core.SolrCore.init(SolrCore.java:579)
at
   
org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:137)
at
   
com.intellisemantic.intellifacet.resource.invertedIndex.InvertedIndexEngine.open(InvertedIndexEngine.java:113)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
   sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
   
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
   
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1536)
at
   
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
at
   
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409)
   [...]

The exception is always thrown while solr init is performed after a 
restart (this is the reason why I'm asking your support ;) )


It seems that while solr is trying to be set up (by [Timer-1]), another 
thread ([Finalizer]) is trying to close it. I can see from the Solr code 
that this exception is thrown always in the same place: SolrCore.java:1068.

Here there is a comment that say:

   // need to close the searcher here??? we shouldn't have to.
  throw new RuntimeException(th);
} finally {
  if (newestSearcher != null) {
newestSearcher.decref();
  }
}

I'm using slorj lib in a Spring container, so I'm supposing that Spring 
will manage the relase of all the singleton classes. Should I do 
something other like force closing solr?


Thanks in advance for your support.

Best regards

Antonio


Re: java.lang.OutOfMemoryError: PermGen space when reopening solr server

2010-09-01 Thread Luke Tebbs


Have you tried to up the MaxHeapSize?

I tend to run solr and the development instance in a separate jetty (on 
a separate port) and actually restart the web server for the dev 
application every now and again.
It doesn't take too long if you only have one webapp on jetty - I tend 
to use mvn jetty:run on the CLI rather than launch jetty in eclipse. I 
also use JRebel to reduce the number of restarts needed during dev.


As for a production instance, should you need to redeploy that often?

Luke

Antonio Calo' wrote:

 Hi guys

I'm facing an error in our production environment with our search 
application based on maven with spring + solrj.


When I try to change a class, or try to redeploy/restart an 
application, I catch a java.lang.OutOfMemoryError: PermGen


I've tryed to understand the cause of this and also I've succeded in 
reproducing this issue on my local develop environment by just 
restarting the jetty several time (I'm using eclipse + maven plugin).


The logs obtained are those:

   [...]
   1078 [Timer-1] INFO org.apache.solr.core.RequestHandlers - created
   /admin/: org.apache.solr.handler.admin.AdminHandlers
   1078 [Timer-1] INFO org.apache.solr.core.RequestHandlers - created
   /admin/ping: PingRequestHandler
   1078 [Timer-1] INFO org.apache.solr.core.RequestHandlers - created
   /debug/dump: solr.DumpRequestHandler
   32656 [Finalizer] INFO org.apache.solr.core.SolrCore - []  CLOSING
   SolrCore org.apache.solr.core.solrc...@1409c28
   17:43:19 ERROR InvertedIndexEngine:124 open -
   java.lang.OutOfMemoryError: PermGen space
   java.lang.RuntimeException: java.lang.OutOfMemoryError: PermGen space
at org.apache.solr.core.SolrCore.getSearcher(SolrCore.java:1068)
at org.apache.solr.core.SolrCore.init(SolrCore.java:579)
at
   
org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:137) 


at
   
com.intellisemantic.intellifacet.resource.invertedIndex.InvertedIndexEngine.open(InvertedIndexEngine.java:113) 


at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
   
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 


at
   
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 


at java.lang.reflect.Method.invoke(Method.java:597)
at
   
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1536) 


at
   
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477) 


at
   
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1409) 


   [...]

The exception is always thrown while solr init is performed after a 
restart (this is the reason why I'm asking your support ;) )


It seems that while solr is trying to be set up (by [Timer-1]), 
another thread ([Finalizer]) is trying to close it. I can see from the 
Solr code that this exception is thrown always in the same place: 
SolrCore.java:1068.

Here there is a comment that say:

   // need to close the searcher here??? we shouldn't have to.
  throw new RuntimeException(th);
} finally {
  if (newestSearcher != null) {
newestSearcher.decref();
  }
}

I'm using slorj lib in a Spring container, so I'm supposing that 
Spring will manage the relase of all the singleton classes. Should I 
do something other like force closing solr?


Thanks in advance for your support.

Best regards

Antonio