As discussed in many questions like here and here it is recognized as a bad practice to return null values instead of empty collections.
I agree that the null returns litter the code with thousands of if (a!= null)
but I wanted to know how this can impact on the memory usage when thousands of calls are done just to return an empty collection or array. Is this to be considered when an application requires memory optimization? Or the garbage collection (e.g. java) takes care of it?