proper way of handling resource utilization and memory limits. TODO: send SIGINT to client on memory error