Upgrading from Grails 1.3.9. to Grails 2.5.6.

283 views
Skip to first unread message

Darryl Pentz

unread,
Apr 6, 2017, 4:16:40 AM4/6/17
to Grails Dev Discuss
Hi all,

So I'm upgrading the web application component of our company product from Grails 1.3.9 to Grails 2.5.6. It's been something we've not had the time to devote to until now, but can no longer afford not to.

So far I've done the following:
- updated all dependency libraries and plugins to be Grails 2.x compatible.
- modified controllers and services to accommodate new requirements (like changing methods to private/protected where necessary)
- updated files installed by 'install-templates'
- updated Config.groovy according to a sample 2.5.6. Config.groovy file
- modified some Service's to use @Transactional to fix a circular dependency

So far, this has gotten me past a wide range of initial errors encountered. However now I'm stuck with 2 issues:

1. Startup of the application is extremely slow
2. Startup doesn't actually complete as it throws an OutOfMemoryError on heap space

I've upped the -Xmx to 1G just to try accommodate that, but to no avail. So my question follows:

What other areas of a v1.3.9 application should I focus on (as in update/upgrade in version or convention) to eliminate possible problems that would manifest running it as v2.5.6.

Any feedback whatsoever would be appreciated, as I'm a little stuck now after scouring the Grails docs for possible conflicts.

Regards,
Darryl Pentz

Justin Miranda

unread,
Apr 7, 2017, 12:18:29 PM4/7/17
to grails-de...@googlegroups.com
Hey Darryl 

I've been working on a similar migration (1.3.x to 2.5.x) and would be happy to share my experience. Here's a ticket that encapsulates some of the post-migration testing I've been trying to do  (https://github.com/openboxes/openboxes/issues/94). There are a bunch of migration guides and blog posts on the web (see the links at the top of that ticket above - the list is not comprehensive by any means). Unfortunately, I didn't have a ticket that includes the migration steps, I just followed some of the migration guides and kept notes somewhere. I believe I have documentation somewhere that highlights some of the major issues I resolved during the process. I'll try to publish that to the ticket (or on our wiki when I get a chance).

As far as I remember, the actual migration steps (most of the same steps you've taken and those) only took a few hours, maybe a day or two. I was able to get my project back up and running pretty quickly -- even bragged to my wife that it only took me a few hours to do. Then reality set in. From that point, the long slog has been fixing broken tests, migrating plugins that needed to be upgraded, and a few other really tedious things. Unfortunately, I only get to work on this particular project a few hours per month so it's taking forever, but it sounds like you're pretty close to the end. 

1. Startup of the application is extremely slow
2. Startup doesn't actually complete as it throws an OutOfMemoryError on heap space

It seems like your memory settings aren't getting picked up? In which environment are you seeing this behavior? Development? Or on a test server? Where are you setting the memory settings? In any case it sounds like 1G should be enough (unless it's doing a lot of object creation during startup) but I would inspect what command-line arguments are actually being used when running the application.

Assuming you're seeing this issue in your development environment on Linux, you can use the following command to see whether your memory config is being used by the grails process. 

$ ps -aux | grep grails

If that's not the case, use whatever tools are at your disposal to inspect those arguments. If the memory settings are present, increase the heap memory. If not, try to figure out where Grails is expecting you to set those properties. If you answer the questions above and I can try to help you with that.

Justin


--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grails-dev-discuss+unsub...@googlegroups.com.
To post to this group, send email to grails-dev-discuss@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/grails-dev-discuss/6d71f17f-cfc2-4fdc-b7ce-0fa5c26c32df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Colin Harrington

unread,
Apr 7, 2017, 12:51:19 PM4/7/17
to grails-de...@googlegroups.com
Darryl, Justin, 

It is usually a good idea when doing a large upgrade to start out with a fresh app and start moving pieces of the application into the new app.  Its recommended to do this piecemeal if you can and test your components along the way.  This can be hard if you have a lot of intertwined components, but hey that's tech debt.  Good version control and compare tooling goes a long way here. 

With Grails 2.3.x, forked mode was introduced.  I'd guess that you have some memory settings to tune in BuildConfig.groovy.  Basically the app runs in it's own separate forked JVM without all of the Build-time libraries and dependencies, but you'll need to tune those JVM settings.

Extremely slow startup times can be an indication that you're approaching a memory threshold and thrashing with too many GCs - the OutOfMemoryError seems to corroborate. 

There are some tools included with the JDK that might help you identify the app's memory constraints.  Checkout JConsole or VisualVM, you probably have them installed already.

Hope that helps

To unsubscribe from this group and stop receiving emails from it, send an email to grails-dev-discuss+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Grails Dev Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grails-dev-discuss+unsub...@googlegroups.com.
To post to this group, send email to grails-dev-discuss@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Colin Harrington
harri...@objectcomputing.com
Grails Developer
@ColinHarrington
Reply all
Reply to author
Forward
0 new messages