I don't have any problem launching simple jobs. From the stack trace it looks like SimpleWriter is doing something with a StringBuffer. Can we see the implementation?
Correct it was the fact the writer which was creating a buffer of every message so i would have like a few thousand of them.
Sorted this now.
Thank you for your help.
Found this thread while having the same issue as the original poster.
I went through the MapJobRepositoryFactoryBean code and if I understood it correctly, job instances and daos are stored in static collections. Does this mean that even if we destroy the Spring context for each run of Batch job, we are still retaining the collections since they are static? Are they not tied to the Spring life cycle of beans?
So we have to always call 'clear' to ensure that we get a fresh repo and cleared memory (unless of course we restart the application and get a fresh jvm). Do you think it would be better that Spring Batch will automatically clear these collections?
On second thought, MapJobRepositoryFactoryBean should only be used for testing. :)