neo4j/community — Issue #279: UDC thread not stopping = memory leak, server crash
Author: pehrlich
Created: 2012-02-26 19:59:00+00:00
State: open

Hi

Randomly., I've been getting the following error on staging/production deploys:

2012-02-26 18:40:25 INFO: jruby 1.6.6 (ruby-1.9.2-p312) (2012-01-30 5673572) (Java HotSpot(TM) Server VM 1.6.0_30) [linux-i386-java]
2012-02-26 18:40:29 SEVERE: unable to create shared application instance
2012-02-26 18:40:29 SEVERE: Error: application initialization failed
2012-02-26 18:40:29 SEVERE: The web application [0.2822942311368223] appears to have started a thread named [Neo4j UDC Timer] but has failed to stop it. This is very likely to create a memory leak.
2012-02-26 18:40:29 INFO: The start() method was called on component [StandardEngine[Tomcat].StandardHost[127.0.0.1].StandardContext[/]] after start() had already been called. The second call will be ignored.
2012-02-26 19:11:08 SEVERE: Warning: error application could not be initialized
2012-02-26 19:38:41 INFO: Info: received max runtimes = 1
2012-02-26 19:38:41 INFO: jruby 1.6.6 (ruby-1.9.2-p312) (2012-01-30 5673572) (Java HotSpot(TM) Server VM 1.6.0_30) [linux-i386-java]
2012-02-26 19:38:42 SEVERE: unable to create shared application instance
2012-02-26 19:38:42 SEVERE: Error: application initialization failed
2012-02-26 19:38:42 INFO: The start() method was called on component [StandardEngine[Tomcat].StandardHost[127.0.0.1].StandardContext[/]] after start() had already been called. The second call will be ignored.
2012-02-26 19:39:02 SEVERE: Warning: error application could not be initialized

I'm trinidad as a server, and the neo4jrb gem. This error occurs seemly randomly. The same commit will trigger it on one server but not another. Unfortunately I don't have more detail on how the server is stopped and started, because I didn't set up the environment.

Anyway, I've been able to rescue from it by rebooting, but I imagine there is a better way of somehow finding the thread and shutting it down.

And the docs say that UDC is optional and can be disabled by simply removing the jar, so I've done that now.
http://docs.neo4j.org/chunked/stable/usage-data-collector.html