We present a novel SIRS model on scale-free networks that takes into account behavioral memory and time delay to depict an adaptive behavioral feedback mechanism, which can better characterize the actual spread of epidemics. We conduct rigorous analysis on the dynamics of the model, including the basic reproduction number R0, uniform persistence and the global asymptotic stability of equilibria. The model has the sharp threshold property, namely, if R0 is less than 1 then the disease-free equilibrium is globally asymptotically stable while if R0 is larger than 1 then the endemic equilibrium is globally asymptotically stable. We further perform an optimal control study for the model to seek effective vaccination and treatment strategies. The existence and uniqueness of these optimal control strategies are demonstrated. Finally, we perform some stochastic network simulations that yield quantitative agreement with the deterministic mean-field approach. Our findings indicate that time delay does not affect R0, but behavioral memory does.