Added LRU-mechanism for freeing resource slots