NEW 131544
cached scripts leak in non JIT mode
https://bugs.webkit.org/show_bug.cgi?id=131544
Summary cached scripts leak in non JIT mode
abaldeva
Reported 2014-04-11 09:40:47 PDT
Hi, If you build JavaScriptCore without JIT support, it leaks cached scripts. This can be verified by continuously reloading the sunspider test suite (any version would do).The C Loop interpreter path memory usage goes up to 200 MB within few minutes. The JIT path does not suffer from this problem. The reason for the leak is ENABLE(JIT) define around few destroy calls in Executable.h/cpp. For example, when a ProgramExecutable is created, it adds a ref to the JSC::SourceCode::m_provider. However, if you turn off JIT, the allocateCell ends up putting it in heap.allocateWithoutDestructor. Since the destructor/destroy is not called anymore, the ref leaks when JIT is not enabled. I have verified that removing ENABLE(JIT) from 6 places in the Executable.h/cpp resolves this issue (around the destroy function declaration/implementation). Executable.h class ExecutableBase - static const bool needsDestruction = true; static const bool hasImmortalStructure = true; static void destroy(JSCell*); + 1 around the definition class NativeExecutable - static void destroy(JSCell*); + 1 around the definition class ScriptExecutable - static void destroy(JSCell*); + 1 around the definition Unfortunately, I am not set up to submit patches as described here(http://www.webkit.org/coding/contributing.html) however hopefully this is enough info to allow somebody else to land the patch. Appreciate your help. Thanks Arpit
Attachments
Radar WebKit Bug Importer
Comment 1 2014-04-11 23:38:40 PDT
Note You need to log in before you can comment on or make changes to this bug.