mirror of
https://github.com/RGBCube/serenity
synced 2025-05-23 19:15:07 +00:00
Kernel: Dump list of processes and their memory usage when OOMing
This commit is contained in:
parent
9e9924115f
commit
3c7b0dab0b
1 changed files with 14 additions and 1 deletions
|
@ -828,8 +828,21 @@ ErrorOr<CommittedPhysicalPageSet> MemoryManager::commit_physical_pages(size_t pa
|
||||||
{
|
{
|
||||||
VERIFY(page_count > 0);
|
VERIFY(page_count > 0);
|
||||||
SpinlockLocker lock(s_mm_lock);
|
SpinlockLocker lock(s_mm_lock);
|
||||||
if (m_system_memory_info.physical_pages_uncommitted < page_count)
|
if (m_system_memory_info.physical_pages_uncommitted < page_count) {
|
||||||
|
dbgln("MM: Unable to commit {} pages, have only {}", page_count, m_system_memory_info.physical_pages_uncommitted);
|
||||||
|
|
||||||
|
Process::for_each([&](Process const& process) {
|
||||||
|
dbgln("{}({}) resident:{}, shared:{}, virtual:{}",
|
||||||
|
process.name(),
|
||||||
|
process.pid(),
|
||||||
|
process.address_space().amount_resident() / PAGE_SIZE,
|
||||||
|
process.address_space().amount_shared() / PAGE_SIZE,
|
||||||
|
process.address_space().amount_virtual() / PAGE_SIZE);
|
||||||
|
return IterationDecision::Continue;
|
||||||
|
});
|
||||||
|
|
||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
m_system_memory_info.physical_pages_uncommitted -= page_count;
|
m_system_memory_info.physical_pages_uncommitted -= page_count;
|
||||||
m_system_memory_info.physical_pages_committed += page_count;
|
m_system_memory_info.physical_pages_committed += page_count;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue