> It would be quite simple to have a thread in the forked process > simply pulsing a heartbeat back to the plugin ? > > And if 3 heartbeats are missed, we simply kill it ? (Pardon the pun ;)
Yeah, I sort of have that already but not in a background thread form (it's a longer story). Anyway, a background thread with heartbeats is still going to work even under OOM conditions as long as you don't load new classes or allocate new resources. This background thread would need to actively check for those low-memory conditions either using crude methods (like trying to allocate an array of bytes or load a dummy class) or some higher-order logic (inspect memory pool statistics returned from management beans). The latter, while more appealing, has the disadvantage that it may try to allocate more memory (or load unseen classes) in which case it'll fail unexpectedly too and these failures are very hard to anticipate. Also, I was kind of concerned about having an active background thread that may interfere with tests somehow (God knows what people but in their tests). I guess you're right though -- there hardly seems to be any other way. Dawid --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@maven.apache.org For additional commands, e-mail: dev-h...@maven.apache.org