Is there any way to do the following without either invoking garbage collection or increasing heap size to avoid eventual GC?

```
List<Long> someList = new ArrayList<Long>();
someList.add(1l);
someList = new ArrayList<Long>(); //Will this cause GC of the old `someList`?

```

So what I'm asking is if the original `ArrayList` will get deleted (and eventually GCd)? If so, how do I remedy this such that I can overwrite the original list without GCing?
['https://Stackoverflow.com/questions/21041564', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2763361/']
Use [ArrayList.clear();](http://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html#clear%28%29) instead of creating new ArrayList

```
someList.clear();

```
I assume by your question you want to keep a reference to the old list (and also its content, otherwise whats the point)? 

If so then just add a reference to it before reassigning:

```
List<Long> someList = new ArrayList<Long>();
someList.add(1L);
List<Long> oldList = someList;
someList = new ArrayList<Long>();

```