After upgrading my runtime to Java 7 I see incredible slowness… and my program is spending all of its time in the SimpleDateFormat constructor. As described in a great post here: http://coffeedriven.org/?p=83 the TimeZone code is now checking for the presence of an application context in the static synchronized method getDefaultInAppContext().
The problem for me is that it’s Spring Batch file reader code that is creating a new SimpleDateFormat object for each line that it reads!
Anyone got a work around for this?
We solved this by making a change to Spring Batch itself. For now the change is in a local copy but I’ve entered a Jira issue and hope to contribute our fix back to Spring Batch itself.
The change itself is to change the use of SimpleDateFormat from a member variable to an injected one (which seems more Spring-like anyway). This lets us control its lifecycle.