简体   繁体   中英

Why does dedicated memory to a process reduces on the server?

I am running a java code on a server. At the beginning, I checked the free memory and I found that more than 20GB of memory was free. Then I ran my code. It firstly started with around 9GB of RAM, but later decreased to around 2.7GB.

I again checked the free memory and it is still around 20GB. But I don't understand why the server has decided to decrease the dedicated memory to my process. While there are some other users who are using around 20GB of RAM for their processes and I know that there is no limitation for the users in the amount of memory they can access.

Can anyone explain why the memory decreases?

If you need more information, I would say that I am talking about the physical memory (RES). The virtual memory dedicated to my process is always 32.8GB. Meanwhile, it takes a lot of time for my code to run. It has been running more than 10 hours. Can the duration of a process be effective? (My own answer would be no, because whenever I check the memory dedications using top command, I see that the other user is using 20GB of RAM and it never changes!

I assume you are talking about Unix / Linux since you are using top .

The most likely reason is that your application has gone into a mode of execution where the working set of objects that it is using actively are all within a relatively small number of memory pages. If your application doesn't read or write to the other pages, the virtual memory system will progressively flush then to disk (if they are dirty) and then add them to the free pool. Presumably, the pages are then being used by other processes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM