I have some questions about garbage collection. If I created an object how would I remove any references to it so it will be Garbage Collected? EX: String text = "Hi", or Person p = new Person(). If I were to create a game, and this game has a
function that spawns enemies. I would do this by creating a class called Enemy. Then I would create a function that would use a for loop to do something like this Enemy e = new Enemy(). It would do this 4 times to create 4 enemies and it would also have to
place them inside a list. If I just did list[1].remove() would that cause the enemy object at list[1] to be Garbage Collected? How often does Garbage Collection run, and what would be the best way to manage memory usage? One other question, when I create a
windows form app I notice that it seems to slowly grow in memory usage and I am not even doing anything with it. All I do is create a window with 2-3 text boxes and a button and when I click the button it adds and displays the numbers I enter it to the text
boxes. Why does the memory usage slowly go up as I use this app.