Using too much memory

You can usually get some benefit from changing Enum to Stream calls as the Stream functions are lazy and do not allocate all that memory up front with each call.