[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:47:34 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 070530cf54421ae0ed28a6f37a1105884a6b2394
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Oct 7 21:06:29 2002 +0000

    	Fixed absurdly high memory usage when looking at pages that use a lot of JavaScript.
    
            * kjs/collector.cpp:
            (Collector::allocate): Implement a new policy of doing a garbage collect every 1000
    	allocations. The old policy was both complicated and misguided.
            (Collector::collect): Zero out the "number of allocations since last collect".
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2267 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/JavaScriptCore/ChangeLog b/JavaScriptCore/ChangeLog
index 3a2f218..c672f28 100644
--- a/JavaScriptCore/ChangeLog
+++ b/JavaScriptCore/ChangeLog
@@ -1,3 +1,12 @@
+2002-10-07  Darin Adler  <darin at apple.com>
+
+	Fixed absurdly high memory usage when looking at pages that use a lot of JavaScript.
+
+        * kjs/collector.cpp:
+        (Collector::allocate): Implement a new policy of doing a garbage collect every 1000
+	allocations. The old policy was both complicated and misguided.
+        (Collector::collect): Zero out the "number of allocations since last collect".
+
 2002-10-06  Darin Adler  <darin at apple.com>
 
 	I noticed some broken lists at mapblast.com and tracked it down to this.
diff --git a/JavaScriptCore/ChangeLog-2002-12-03 b/JavaScriptCore/ChangeLog-2002-12-03
index 3a2f218..c672f28 100644
--- a/JavaScriptCore/ChangeLog-2002-12-03
+++ b/JavaScriptCore/ChangeLog-2002-12-03
@@ -1,3 +1,12 @@
+2002-10-07  Darin Adler  <darin at apple.com>
+
+	Fixed absurdly high memory usage when looking at pages that use a lot of JavaScript.
+
+        * kjs/collector.cpp:
+        (Collector::allocate): Implement a new policy of doing a garbage collect every 1000
+	allocations. The old policy was both complicated and misguided.
+        (Collector::collect): Zero out the "number of allocations since last collect".
+
 2002-10-06  Darin Adler  <darin at apple.com>
 
 	I noticed some broken lists at mapblast.com and tracked it down to this.
diff --git a/JavaScriptCore/ChangeLog-2003-10-25 b/JavaScriptCore/ChangeLog-2003-10-25
index 3a2f218..c672f28 100644
--- a/JavaScriptCore/ChangeLog-2003-10-25
+++ b/JavaScriptCore/ChangeLog-2003-10-25
@@ -1,3 +1,12 @@
+2002-10-07  Darin Adler  <darin at apple.com>
+
+	Fixed absurdly high memory usage when looking at pages that use a lot of JavaScript.
+
+        * kjs/collector.cpp:
+        (Collector::allocate): Implement a new policy of doing a garbage collect every 1000
+	allocations. The old policy was both complicated and misguided.
+        (Collector::collect): Zero out the "number of allocations since last collect".
+
 2002-10-06  Darin Adler  <darin at apple.com>
 
 	I noticed some broken lists at mapblast.com and tracked it down to this.
diff --git a/JavaScriptCore/kjs/collector.cpp b/JavaScriptCore/kjs/collector.cpp
index d7da33a..90f3d46 100644
--- a/JavaScriptCore/kjs/collector.cpp
+++ b/JavaScriptCore/kjs/collector.cpp
@@ -83,11 +83,19 @@ bool Collector::memLimitReached = false;
 bool Collector::collecting = false;
 #endif
 
+#if APPLE_CHANGES
+static int numAllocationsSinceLastCollect = 0;
+#endif
+
 void* Collector::allocate(size_t s)
 {
   if (s == 0)
     return 0L;
 
+#if APPLE_CHANGES
+  if (++numAllocationsSinceLastCollect >= KJS_MEM_INCREMENT)
+    collect();
+#else
   // Try and deal with memory requirements in a scalable way. Simple scripts
   // should only require small amounts of memory, but for complex scripts we don't
   // want to end up running the garbage collector hundreds of times a second.
@@ -108,6 +116,7 @@ void* Collector::allocate(size_t s)
       increaseLimitAt *= 2;
     }
   }
+#endif
 
   void *m = malloc(s);
 #ifdef KJS_DEBUG_MEM
@@ -250,6 +259,10 @@ bool Collector::collect()
     block = next;
   }
 
+#if APPLE_CHANGES
+  numAllocationsSinceLastCollect = 0;
+#endif
+
 #if 0
   // This is useful to track down memory leaks
   static int s_count = 0;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list