We present a memory-based snowdrift game (MBSG) taking place on networks. We found that, when a lattice is taken to be the underlying structure, the transition of spatial patterns at some critical values of the payoff parameter is observable for both 4 and 8-neighbor lattices. The transition points as well as the styles of spatial patterns can be explained by local stability analysis. In sharp contrast to previously reported results, cooperation is promoted by the spatial structure in the MBSG. Interestingly, we found that the frequency of cooperation of the MBSG on a scale-free network peaks at a specific value of the payoff parameter. This phenomenon indicates that properly encouraging selfish behaviors can optimally enhance the cooperation. The memory effects of individuals are discussed in detail and some non-monotonous phenomena are observed on both lattices and scale-free networks. Our work may shed some new light on the study of evolutionary games over networks.