There can be no definite duration based answer to "How long does it stay in memory"
The best answer would probably be: "Until it is cleaned up by the Garbage Collector"
And a garbage collection runs "when it needs to"
It very much depends on the settings you choose for the garbage collector.
A quick google brought up an article:
Understanding Java Garbage Collection which explains it better than I ever could.
In general:
Those "new Integers" you create will be allocated memory in the Eden space.
When a GC runs in the eden space, it uses a "Mark and Sweep" algorithm to copy only those values that are currently "alive" (able to be accessed) to the "Survivor" space
In Question 1 it would retain only those items still in the list. The one that got removed wouldn't be accessible, so it would not be copied to the "Survivor" space.
In Question 2 it would depend on if the variable num2 was still "alive" or not when the garbage collector ran.