[Webkit-unassigned] [Bug 24615] JavascriptCore reports leaks

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu May 30 10:03:39 PDT 2013


https://bugs.webkit.org/show_bug.cgi?id=24615


Scott <bugs.webkit.org at scottdavies.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugs.webkit.org at scottdavies
                   |                            |.net




--- Comment #7 from Scott <bugs.webkit.org at scottdavies.net>  2013-05-30 10:02:10 PST ---
Four years later, I'm seeing this behavior in the JavaScriptCore framework installed on OS X 10.8.3.  Awesome.

Trivial experiments reveal that there's actually a leak of some sort in the JSContextGroupCreate / JSContextGroupRelease pair.   The following program consumes unbounded amounts of memory:


// testjsc.cpp.  To compile: clang++ testjsc.cpp -o testjsc -framework JavaScriptCore
#include <JavaScriptCore/JavaScript.h>
int main(int argc, char** argv) {
  while (true) {
    JSContextGroupRef contextGroup = JSContextGroupCreate();
    JSContextGroupRelease(contextGroup);
  }
  return 0;
}

For comparison, the following program never seems to consume more than about 4 MB:

#include <JavaScriptCore/JavaScript.h>
int main(int argc, char** argv) {
  JSContextGroupRef contextGroup = JSContextGroupCreate();
  while (true) {
    JSGlobalContextRef ctx = JSGlobalContextCreateInGroup(contextGroup, NULL);
    JSGlobalContextRelease(ctx);
  }
  JSContextGroupRelease(contextGroup);
  return 0;
}

So there's a leak in the context group code, but global contexts can be created and destroyed with no leaks as long as they reuse existing context groups.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list