harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r567563 - /harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSResourcesMonitor.java
Date Mon, 20 Aug 2007 07:04:40 GMT
Author: leoli
Date: Mon Aug 20 00:04:36 2007
New Revision: 567563

URL: http://svn.apache.org/viewvc?rev=567563&view=rev
Log:
Refractor in org.apache.harmony.luni.platform.OSResourcesMonitor(Delete two useless constants).

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSResourcesMonitor.java

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSResourcesMonitor.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSResourcesMonitor.java?rev=567563&r1=567562&r2=567563&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSResourcesMonitor.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSResourcesMonitor.java
Mon Aug 20 00:04:36 2007
@@ -22,30 +22,24 @@
 
     private static final int SLEEP_TIME = 50;
 
-    private static final long FREE_MEMORY_THRESHOLD = 64 * 1024 * 1024; // 64M.
-
-    private static final int MEMORY_LOAD_THRESHOLD = 80; // 80%
-                                                                            // left.
-
     public static void ensurePhysicalMemoryCapacity() {
-        if (!isSystemPhysicalMemoryLow()) {           
+        if (!isSystemPhysicalMemoryLow()) {
             return;
         }
         synchronized (OSResourcesMonitor.class) {
             int iteration = 0;
-            while (isSystemPhysicalMemoryLow()) {               
-                if (iteration > MAX_ITERATION_TIMES) {                    
+            while (isSystemPhysicalMemoryLow()) {
+                if (iteration > MAX_ITERATION_TIMES) {
                     return;
-                }                
+                }
                 iteration++;
-                System.gc();                
+                System.gc();
                 try {
                     Thread.sleep(SLEEP_TIME);
                 } catch (InterruptedException e) {
 
                 }
             }
-
         }
     }
 



Mime
View raw message