Linear and nonlinear evolutions of the resistive wall mode(RWM) were numerically carried out with different plasma density profiles.Both stabilizing and destabilizing effects were observed.The plasma density shear had a stabilizing effect on the RWM,and the stabilizing effect was better as the plasma density shear rate increased.In the uniform density plasma,the effects of flowshear on the RWMstability were stronger than those for non-uniform density plasma.For lower flowshear,the effects of the plasma density shear rate on the RWMwere more obvious.In the nonlinear phase,the repulsive force associated with the piling up magnetic flux near the resistive wall prevented further growth of perturbed magnetic energy,and the RWMwas saturated.The saturation levels were almost independent of the density profiles.