server: Limit the number of allocated handles before running out of memory.