Author: xor
Date: 2007-12-23 11:00:07 +0000 (Sun, 23 Dec 2007)
New Revision: 16803
Modified:
trunk/freenet/src/freenet/node/NodeStats.java
Log:
provide indentation for the previous commit
Modified: trunk/freenet/src/freenet/node/NodeStats.java
===================================================================
--- trunk/freenet/src/freenet/node/NodeStats.java 2007-12-23 10:54:03 UTC
(rev 16802)
+++ trunk/freenet/src/freenet/node/NodeStats.java 2007-12-23 11:00:07 UTC
(rev 16803)
@@ -515,25 +515,25 @@
/* There are some JVMs (for example libgcj 4.1.1) whose
Runtime.maxMemory() does not work. */
if(maxHeapMemory < Long.MAX_VALUE) { // would mean unlimited
- long totalHeapMemory = r.totalMemory();
- long freeHeapMemory = r.freeMemory();
+ long totalHeapMemory = r.totalMemory();
+ long freeHeapMemory = r.freeMemory();
freeHeapMemory = maxHeapMemory - (totalHeapMemory -
freeHeapMemory);
- if(freeHeapMemory < freeHeapBytesThreshold) {
- pInstantRejectIncoming.report(1.0);
- rejected("<freeHeapBytesThreshold", isLocal);
- return "<freeHeapBytesThreshold
("+SizeUtil.formatSize(freeHeapMemory, false)+" of
"+SizeUtil.formatSize(maxHeapMemory, false)+')';
+ if(freeHeapMemory < freeHeapBytesThreshold) {
+ pInstantRejectIncoming.report(1.0);
+ rejected("<freeHeapBytesThreshold", isLocal);
+ return "<freeHeapBytesThreshold
("+SizeUtil.formatSize(freeHeapMemory, false)+" of
"+SizeUtil.formatSize(maxHeapMemory, false)+')';
+ }
+ double percentFreeHeapMemoryOfMax = ((double)
freeHeapMemory) / ((double) maxHeapMemory);
+ double freeHeapPercentThresholdDouble = ((double)
freeHeapPercentThreshold) / ((double) 100);
+ if(percentFreeHeapMemoryOfMax <
freeHeapPercentThresholdDouble) {
+ pInstantRejectIncoming.report(1.0);
+ DecimalFormat fix3p1pct = new
DecimalFormat("##0.0%");
+ rejected("<freeHeapPercentThreshold", isLocal);
+ return "<freeHeapPercentThreshold
("+SizeUtil.formatSize(freeHeapMemory, false)+" of
"+SizeUtil.formatSize(maxHeapMemory, false)+"
("+fix3p1pct.format(percentFreeHeapMemoryOfMax)+"))";
+ }
}
- double percentFreeHeapMemoryOfMax = ((double) freeHeapMemory) /
((double) maxHeapMemory);
- double freeHeapPercentThresholdDouble = ((double)
freeHeapPercentThreshold) / ((double) 100);
- if(percentFreeHeapMemoryOfMax < freeHeapPercentThresholdDouble)
{
- pInstantRejectIncoming.report(1.0);
- DecimalFormat fix3p1pct = new DecimalFormat("##0.0%");
- rejected("<freeHeapPercentThreshold", isLocal);
- return "<freeHeapPercentThreshold
("+SizeUtil.formatSize(freeHeapMemory, false)+" of
"+SizeUtil.formatSize(maxHeapMemory, false)+"
("+fix3p1pct.format(percentFreeHeapMemoryOfMax)+"))";
- }
- }
if(source != null) {
long queuedBytes = source.getMessageQueueLengthBytes();