support for max size and automatic deletion