Author: rfm
Date: Mon Jul 6 20:44:14 2015
New Revision: 38756
URL: http://svn.gna.org/viewcvs/gnustep?rev=38756&view=rev
Log:
iMore tolerant alerting
Modified:
libs/ec/trunk/ChangeLog
libs/ec/trunk/EcProcess.h
libs/ec/trunk/EcProcess.m
Modified: libs/ec/trunk/ChangeLog
URL:
http://svn.gna.org/viewcvs/gnustep/libs/ec/trunk/ChangeLog?rev=38756&r1=38755&r2=38756&view=diff
==============================================================================
--- libs/ec/trunk/ChangeLog (original)
+++ libs/ec/trunk/ChangeLog Mon Jul 6 20:44:14 2015
@@ -1,3 +1,13 @@
+2015-07-06 Richard Frith-Macdonald <[email protected]>
+
+ * EcProcess.h:
+ * EcProcess.m:
+ Various tweaks to leak alert generation. Change default initial
+ thresholds and change increments after an alert to be based upon
+ the *peak* usage at the point when the alert was generated, rather
+ than on the previous threshodld. This reduces the number of alerts
+ in a process whose memory usage grows rapidly on startup.
+
2015-07-03 Richard Frith-Macdonald <[email protected]>
* EcProcess.h:
Modified: libs/ec/trunk/EcProcess.h
URL:
http://svn.gna.org/viewcvs/gnustep/libs/ec/trunk/EcProcess.h?rev=38756&r1=38755&r2=38756&view=diff
==============================================================================
--- libs/ec/trunk/EcProcess.h (original)
+++ libs/ec/trunk/EcProcess.h Mon Jul 6 20:44:14 2015
@@ -103,12 +103,13 @@
</desc>
<term>EcMemoryIncrement</term>
<desc>
- This integer value controls the (KBytes) increment in process
- memory usage after which an alert is generated.<br />
+ This integer value controls the (KBytes) increment (from
+ current peak value) in process memory usage after which
+ an alert is generated.<br />
If this is not set (or is set to a value less than ten or
greater than a million) then a value of five thousand is used
unless EcMemory is set (in which case twenty is used).<br />
- Setting a higher value make memory leak detection less
+ Setting a higher value makes memory leak detection less
sensitive (but reduces unnecessary alerts).<br />
If used in conjunction with EcMemoryPercentage, the greater
of the two allowed memory values is used.<br />
@@ -127,12 +128,12 @@
<term>EcMemoryPercentage</term>
<desc>
This integer value controls the increase in the alerting
- threshold after which a memory usage alert is generated.<br />
- The increase is calcuilated as a percentage of the current
- memory usage value when an alert is generated.<br />
+ threshold after which a memory usage alert is generated.<br />
+ The increase is calculated as a percentage of the current
+ peak memory usage value when an alert is generated.<br />
If this is not set (or is set to a value less than one or
greater than a thousand) then a value of ten is used unless
- EcMemory is set (in which one is used).<br />
+ EcMemory is set (in which case a value of one is used).<br />
Setting a higher value make memory leak detection less
sensitive (but reduces unnecessary alerts).<br />
If used in conjunction with EcMemoryIncrement, the greater
Modified: libs/ec/trunk/EcProcess.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/ec/trunk/EcProcess.m?rev=38756&r1=38755&r2=38756&view=diff
==============================================================================
--- libs/ec/trunk/EcProcess.m (original)
+++ libs/ec/trunk/EcProcess.m Mon Jul 6 20:44:14 2015
@@ -2391,11 +2391,6 @@
NSInteger iMax = 0;
NSInteger pMax = 0;
- /* Alert because the average has risen above the allowed size.
- */
- [self cmdError: @"Average memory usage grown to %"PRIu64"KB",
- memAvge / 1024];
-
/* We increase the threshold for the next alert by a percentage
* of the existing usage or by a fixed increment, whichever is
* the larger.
@@ -2429,17 +2424,22 @@
}
if (inc > 0)
{
- iMax = memWarn + (inc * 1024);
+ iMax = memPeak + (inc * 1024);
}
if (pct > 0)
{
- pMax = (memWarn * (100 + pct)) / 100;
+ pMax = (memPeak * (100 + pct)) / 100;
}
memWarn = (iMax > pMax) ? iMax : pMax;
if (memWarn % 1024)
{
memWarn = (memWarn / 1024 + 1) * 1024;
}
+
+ /* Alert because the average has risen above the allowed size.
+ */
+ [self cmdError: @"Average memory usage grown to %"PRIu64"KB",
+ memAvge / 1024];
}
if (YES == [cmdDefs boolForKey: @"Memory"])
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs