What does quoting "Private_Dirty" mean?

I have a huge processor that consumes RAM, and I'm trying to figure out what it does with all this memory. So, I am doing pmap -x on this PID, and here is part of the result:

Address Kbytes RSS Dirty Mode Mapping 0000000000001000 4 0 0 rw--- [ anon ] 0000000000400000 48 0 0 rx-- java 000000000050b000 4 4 4 rw--- java 0000000003b9d000 264 224 212 rw--- [ anon ] 0000000003bdf000 2199556 1887992 1830160 rw--- [ anon ] 000000396c800000 112 108 0 rx-- ld-2.5.so 000000396ca1c000 4 4 4 r---- ld-2.5.so [...] ffffffffff600000 8192 0 0 ----- [ anon ] ---------------- ------ ------ ------ total kB 7072968 4382820 4270104 

As you can see at 3BDF000, there is a mapping of 2199556 Kbytes from 1830160 of Dirty.

In / proc / 10139 / smaps, on, you can see it in more detail:

 03bdf000-89fe0000 rw-p 03bdf000 00:00 0 Size: 2199556 kB Rss: 1887996 kB Shared_Clean: 0 kB Shared_Dirty: 0 kB Private_Clean: 57832 kB Private_Dirty: 1830164 kB Swap: 231996 kB Pss: 1887996 kB 

So, I would like to know what kind of dirty memory it is? I think these pages do not need to be written to disk, so why are they called dirty?

+4
source share
1 answer

The memory is either personal, that is, it is exclusive to this process or shared, that is, several processes can be displayed and used (think about the general code of the library, etc.). The memory can also be clean - it has not been changed since it was loaded from disk or provided as zero-filled pages or something else, and therefore, if it needs to be freed up to provide memory pages for other processes, it can be just drop it, and reboots / refills if it is ever needed again - or dirty, which means that if it needs to be freed, it must be discharged into the swap area so that the changed contents can be restored if necessary.

It is not necessary to see a large amount of private dirty data in the process. The problem is that the sum of all confidential dirty data in all processes in the system becomes a significant part (the exact numbers depend largely on your workload and acceptable performance) of your total physical memory, and everything should start with the fact that they are swapped ...

+8
source

Source: https://habr.com/ru/post/969533/


All Articles