Changeset 2267 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Oct 7, 2002, 2:06:29 PM (23 years ago)
Author:
darin
Message:

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".
Location:
trunk/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r2262 r2267  
     12002-10-07  Darin Adler  <[email protected]>
     2
     3        Fixed absurdly high memory usage when looking at pages that use a lot of JavaScript.
     4
     5        * kjs/collector.cpp:
     6        (Collector::allocate): Implement a new policy of doing a garbage collect every 1000
     7        allocations. The old policy was both complicated and misguided.
     8        (Collector::collect): Zero out the "number of allocations since last collect".
     9
    1102002-10-06  Darin Adler  <[email protected]>
    211
  • trunk/JavaScriptCore/ChangeLog-2002-12-03

    r2262 r2267  
     12002-10-07  Darin Adler  <[email protected]>
     2
     3        Fixed absurdly high memory usage when looking at pages that use a lot of JavaScript.
     4
     5        * kjs/collector.cpp:
     6        (Collector::allocate): Implement a new policy of doing a garbage collect every 1000
     7        allocations. The old policy was both complicated and misguided.
     8        (Collector::collect): Zero out the "number of allocations since last collect".
     9
    1102002-10-06  Darin Adler  <[email protected]>
    211
  • trunk/JavaScriptCore/ChangeLog-2003-10-25

    r2262 r2267  
     12002-10-07  Darin Adler  <[email protected]>
     2
     3        Fixed absurdly high memory usage when looking at pages that use a lot of JavaScript.
     4
     5        * kjs/collector.cpp:
     6        (Collector::allocate): Implement a new policy of doing a garbage collect every 1000
     7        allocations. The old policy was both complicated and misguided.
     8        (Collector::collect): Zero out the "number of allocations since last collect".
     9
    1102002-10-06  Darin Adler  <[email protected]>
    211
  • trunk/JavaScriptCore/kjs/collector.cpp

    r1811 r2267  
    8484#endif
    8585
     86#if APPLE_CHANGES
     87static int numAllocationsSinceLastCollect = 0;
     88#endif
     89
    8690void* Collector::allocate(size_t s)
    8791{
     
    8993    return 0L;
    9094
     95#if APPLE_CHANGES
     96  if (++numAllocationsSinceLastCollect >= KJS_MEM_INCREMENT)
     97    collect();
     98#else
    9199  // Try and deal with memory requirements in a scalable way. Simple scripts
    92100  // should only require small amounts of memory, but for complex scripts we don't
     
    109117    }
    110118  }
     119#endif
    111120
    112121  void *m = malloc(s);
     
    251260  }
    252261
     262#if APPLE_CHANGES
     263  numAllocationsSinceLastCollect = 0;
     264#endif
     265
    253266#if 0
    254267  // This is useful to track down memory leaks
Note: See TracChangeset for help on using the changeset viewer.