Two questions, really. I'm running large batch jobs with an agent. The jobs 
may fail in any number of unanticipated ways (due to user input), so I do a 
try/catch in the agent, log any errors, and continue with the next job.

First question: how to deal with OOM (the Xmx limit, not the OS out of 
mem)? The try/catch doesn't appear to help, here. The agent dies, and all 
subsequent jobs never run. Is there some way to prevent or recover from 
this?

I posed this to a long-time java developer, who said I shouldn't be doing a 
blanket try/catch in the first place, because it's likely to result in 
leaked memory (presumably due to badly-coded libs that don't release 
resources on error). His suggestion: let the thread die on error, and 
restart it from a monitoring thread. I'm not sure how this translates to 
clojure agents. If I don't catch the errors, then log the agent error state 
and restart it, is that equivalent? Is this best practice? Seems like 
badly-coded libs could still leak memory this way, if they've stashed a 
reference in any shared state.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to