On Monday, August 11, 2014 10:08:09 PM UTC-7, Jeremy Heiler wrote:
>
> On Mon, Aug 11, 2014 at 3:07 PM, Brian Craft <craft...@gmail.com 
> <javascript:>> wrote:
>
>> 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?
>>
>
> Once it has happened, I don't think there's much you can do to save the 
> process. I'd suggest that you figure out where you're improperly managing 
> memory by throwing a profiler at it.
>

Profiling is not going to change user behavior: users can give us inputs 
too large for their systems. If we can't recover from it, then we need to 
predict the event and abort. Perhaps we could monitor heap usage in another 
thread, and shut down the agent if it goes past some fraction. But there 
doesn't appear to be any mechanism for shutting down an agent. Maybe the 
agent action could stash the thread id in an atom, and a watcher thread 
could shut it down somehow.

-- 
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