Explicitly constructing a new empty list will use more memory. Most (if not all) implementations of List
have some book keeping and overhead (size, head, tail, etc) that are incurred. eg. LinkedList
has a tail and a head which is going to use up some more memory when instantiated.
Ultimately null will only use 4-8 bytes depending on whether you're running a 32 or 64 bit platform.
As mentioned in other answers, if you only ever need and empty list you should use Collections.emptyList()
, however if you do need a mutable list you won't be able to use this as the instance you'll get back is immutable.
To answer the initial question about ArrayList
, the implementation only has a single extra field other than the stored elements, size
. So although it won't use as little space as null
the overhead is miniscule.
TLDR; null will only use the space needed to store a 32 or 64 bit pointer, an actual instantiation of a list implementation will consume more memory because of some state that is held on the implementation.