Taking into account the mass splittings between three active neutrinos , we investigate impacts of dark energy on constraining the total neutrino mass \sum m _ { \nu } by using recent cosmological observations . We consider two typical dark energy models , namely , the w CDM model and the holographic dark energy ( HDE ) model , which both have an additional free parameter compared with the \Lambda CDM model . We employ the Planck 2015 data of CMB temperature and polarization anisotropies , combined with low-redshift measurements on BAO distance scales , type Ia supernovae , Hubble constant , and Planck lensing . Compared to the \Lambda CDM model , our study shows that the upper limit on \sum m _ { \nu } becomes much looser in the w CDM model while much tighter in the HDE model . In the HDE model , we obtain the 95 \% CL upper limit \sum m _ { \nu } < 0.105 ~ { } \textrm { eV } for three degenerate neutrinos . This might be the most stringent constraint on \sum m _ { \nu } by far and is almost on the verge of diagnosing the neutrino mass hierachies in the HDE model . However , the difference of \chi ^ { 2 } is still not significant enough to distinguish the neutrino mass hierarchies , even though the minimal \chi ^ { 2 } of the normal hierarchy is slightly smaller than that of the inverted hierarchy .