Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: reuse of job with different parameters outofmemoryexception - heap space

  1. #11
    Join Date
    Jun 2005
    Posts
    4,230

    Default

    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?

  2. #12

    Default

    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.

  3. #13

    Default

    Hi Dave,
    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?

    Thanks.

    On second thought, MapJobRepositoryFactoryBean should only be used for testing.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •