mirror of
https://github.com/gnustep/libs-ec.git
synced 2025-05-31 09:21:12 +00:00
Log how much memory exceeded maximum by
This commit is contained in:
parent
08c039f522
commit
b6dbc6efa6
1 changed files with 16 additions and 10 deletions
26
EcProcess.m
26
EcProcess.m
|
@ -6516,16 +6516,22 @@ With two parameters ('maximum' and a number),\n\
|
||||||
[self alarm: a];
|
[self alarm: a];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (memMaximum > 0 && memPeak > (memMaximum * 1024 * 1024))
|
if (memMaximum > 0)
|
||||||
{
|
{
|
||||||
if (NO == memRestart)
|
int64_t excess = memPeak - (memMaximum * 1024 * 1024);
|
||||||
{
|
|
||||||
memRestart = YES;
|
if (excess > 0)
|
||||||
NSLog(@"MemoryMaximum exceeded ... initiating restart");
|
{
|
||||||
[self ecRestart: @"memory usage limit reached"];
|
if (NO == memRestart)
|
||||||
}
|
{
|
||||||
return;
|
memRestart = YES;
|
||||||
}
|
NSLog(@"MemoryMaximum exceeded by %ll bytes"
|
||||||
|
@" ... initiating restart", (long long)excess);
|
||||||
|
[self ecRestart: @"memory usage limit reached"];
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setMemBase();
|
setMemBase();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue