Ignore:
Timestamp:
Feb 22, 2008, 3:16:40 PM (17 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

Reviewed by Sam Weinig.


Partial fix for <rdar://problem/5744037> Gmail out of memory (17455)


I'm removing KJS_MEM_LIMIT for the following reasons:


  • We have a few reports of KJS_MEM_LIMIT breaking important web applications, like GMail and Google Reader. (For example, if you simply open 12 GMail tabs, tab #12 will hit the limit.)
  • Firefox has no discernable JS object count limit, so any limit, even a large one, is a potential compatibility problem.


  • KJS_MEM_LIMIT does not protect against malicious memory allocation, since there are many ways to maliciously allocate memory without increasing the JS object count.


  • KJS_MEM_LIMIT is already mostly broken, since it only aborts the script that breaches the limit, not any subsequent scripts.


  • We've never gotten bug reports about websites that would have benefited from an unbroken KJS_MEM_LIMIT. The initial check-in of KJS_MEM_LIMIT (KJS revision 80061) doesn't mention a website that needed it.


  • Any website that brings you anywhere close to crashing due to the number of live JS objects will almost certainly put up the "slow script" dialog at least 20 times beforehand.
  • kjs/collector.cpp: (KJS::Collector::collect):
  • kjs/collector.h:
  • kjs/nodes.cpp: (KJS::TryNode::execute):

LayoutTests:

Reviewed by Sam Weinig.


Removing the test for KJS_MEM_LIMIT, since I removed KJS_MEM_LIMIT.

  • fast/js/out-of-memory-expected.txt: Removed.
  • fast/js/out-of-memory.html: Removed.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/collector.cpp

    r29710 r30492  
    106106// Just a private global like "heap" above would be fine.
    107107size_t Collector::mainThreadOnlyObjectCount = 0;
    108 
    109 bool Collector::memoryFull = false;
    110108
    111109static CollectorBlock* allocateBlock()
     
    971969  numberHeap.operationInProgress = NoOperation;
    972970 
    973   bool newMemoryFull = (numLiveObjects >= KJS_MEM_LIMIT);
    974   if (newMemoryFull && newMemoryFull != memoryFull)
    975       reportOutOfMemoryToAllExecStates();
    976   memoryFull = newMemoryFull;
    977 
    978971  return numLiveObjects < originalLiveObjects;
    979972}
Note: See TracChangeset for help on using the changeset viewer.