I'm running a piece of OCR software [with gui, etc] on OSX that watches a folder and OCRs PDFs that are put in there. Occasionally the process starts behaving poorly and consumes a huge amount of system memory and CPU, running indefinitely on a particular PDF.
- I'd like to know how to monitor that process to kill it under such circumstances.
- I'd also like to prevent it from bringing the system to a halt, e.g. by sandboxing somehow.