Opened 4 years ago
Last modified 4 years ago
#16622 new bug
kernel: system_info.used_pages don't include mapped files — at Initial Version
Reported by: | X512 | Owned by: | nobody |
---|---|---|---|
Priority: | normal | Milestone: | Unscheduled |
Component: | System/Kernel | Version: | R1/Development |
Keywords: | Cc: | mmlr | |
Blocked By: | Blocking: | ||
Platform: | All |
Description
This is hrev54741.
As discussed here, mapping files to read-only areas almost not affect system_info.used_pages
that is used by most memory inspecting utilities, but it actually consumes memory and make allocations not possible if too many files are mapped. system_info.needed_memory
provides correct information about free memory but is also seems to include disk cache that can be freed to release memory for allocations.
If memory mapped files are consuming memory, they should be included in system_info.used_pages
.
Actually it is not required to reserve memory for read-only mapped files because it can be handled in similar way as disk cache: load file contents on demand and unload when memory is needed by someone else. This approach do not violate no overcommit policy. If program change area protection and enable copy-on-write, attempt may failed with out of memory if memory can't be reserved.
Test program.