Problems with hotdeploy

31 views
Skip to first unread message

Topping Bowers

unread,
Jun 12, 2012, 5:28:23 PM6/12/12
to rails-t...@googlegroups.com
Hi,

We were having what I thought was a run-of-the-mill memory leak during hot deploy.  I have since been informed that java7 fixes the problem and it appears that the upgrade *does* fix the memory leak itself.  However, I'm still having problems with the app (multiple logging and unable to stop).

This gist is the stdout logging from running a simple trinidad with -server flag set on JAVA_OPTS: https://gist.github.com/2919241

The minimum rails app is here: https://github.com/Amicus/trini_tester

Java 7 seems to not actually leak memory the way 6 did during these restarts - but stopping becomes impossible after around 5 or 6 touches. And as you can see the logging == the number of hot deploys being done too.

As you can see from the minimal rails app, nothing crazy is going on here... no Db connections, etc.

Any thoughts?

Thanks,

Topper

kares

unread,
Jun 15, 2012, 5:48:07 AM6/15/12
to rails-t...@googlegroups.com

 Hi Topper, I must say this definitely deserves some more investigation.

A while back on Java 6 I tried to profile this issue down but failed probably due the resource bug itself.
I remember having the exact same issue of Trinidad not stopping after a few touches regardless of memory it got.
Thus I would say it's an old issue (not introduced with Java 7) - worth a fresh look with a tool such as VisualVM.

K.

Topping Bowers

unread,
Jun 15, 2012, 11:58:54 AM6/15/12
to rails-t...@googlegroups.com
I spent some time messing around in the code and have some interesting clues and a fix, but I'm not sure *why* the fix works.

Java 7 does indeed fix the memory leak problem... so that's good. A few changes I made here: https://github.com/amicus/trinidad fix the "unable to stop" problem.

https://github.com/Amicus/trinidad/blob/master/lib/trinidad/lifecycle/lifecycle_listener_host.rb#L49  (I kept getting 'start already called').  Somehow, the context is already started by that line... maybe the new tomcat automatically starts?

https://github.com/Amicus/trinidad/blob/master/lib/trinidad/lifecycle/takeover.rb#L16 removing the child from the parent explicitly also is needed.

With both those changes and java7 I am able to successfully hot deploy to my hearts content and shutdown.  I was running jvisualvm the whole time and I now see classes properly unloading and memory remaining consistent.

Topper

--
Has recibido este mensaje porque estás suscrito al grupo "Rails Trinidad" de Grupos de Google.
Para ver este debate en la Web, visita https://groups.google.com/d/msg/rails-trinidad/-/4urrHi4kYL4J.
Para publicar una entrada en este grupo, envía un correo electrónico a rails-t...@googlegroups.com.
Para anular tu suscripción a este grupo, envía un correo electrónico a rails-trinida...@googlegroups.com
Para tener acceso a más opciones, visita el grupo en http://groups.google.com/group/rails-trinidad?hl=es.



--
Topper Bowers

top...@toppingdesign.com
http://croonmytune.com
http://blog.toppingdesign.com

kares

unread,
Jun 16, 2012, 3:38:17 AM6/16/12
to rails-t...@googlegroups.com

 Interesting, I'm really not sure how that works without the start, are you sure you actually re-deployed the app and not kept the same version :) ?

Anyways, I find out a piece of bug in the redeploy code - we do not see it cause the logger is not printing exception traces, so I shall fix those.
Would be great if you reported this as an issue so we can further do some testing with my fixes when they arrive and possibly take a look at your changes as well to hopefully work this out once for all ...

Thanks, K.
Topper

Para publicar una entrada en este grupo, envía un correo electrónico a rails-trinidad@googlegroups.com.
Para anular tu suscripción a este grupo, envía un correo electrónico a rails-trinidad+unsubscribe@googlegroups.com

Para tener acceso a más opciones, visita el grupo en http://groups.google.com/group/rails-trinidad?hl=es.
Reply all
Reply to author
Forward
0 new messages