Increasing use of software, rapid and unavoidable changes in the operational environment bring many problems for software engineers. One of these problems is the aging and degradation of software performance. Software rejuvenation is a proactive and preventive approach to counteract software aging. Generally, when software is initiated, amounts of memory are allocated. Then, the body of software is executed for providing a service and when the software is terminated, the allocated memory is released. In this paper, a rejuvenation model based on multilevel software rejuvenation and Markov chain presented. In this model, the system performance as a result of degraded physical memory and memory usage is divided into four equal levels by services. Hence, we offer four types of policies for software rejuvenation. In addition, the system availability is determined, and a cost function for the model is introduced. The cost function includes the time of performing rejuvenation, the number of system services at any time, and the number of rejuvenation actions. To validate the proposed model, a case study in the banking system in Iran has been studied. Due to the differences in the use of the system over time, it is better to perform the four different policies with regard to the use of the system. The numerical results show that the proposed model is convenient for the system so that the costs are reduced per day.