Reuse the same arrays Clear only the range that needs to be cleared Reduce the MAX_EVENTS constant to 100