I was hoping to find out any information on practices to optimize for garbage collection or prevent object's from building up in memory over time.
As an example, let's say I have a continuous iteration and each time an item is added to an object.
Over time, older items added to the object are no longer relevant for the application, and should be removed from the object, they will never again be accessed. Is it necessary to specifically remove these values or would it continue to just build up into a huge object?
Thank you!