Closed Bug 511252 Opened 15 years ago Closed 15 years ago

TM: explicitly disable code caches during shutdown

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
status1.9.2 --- beta1-fixed

People

(Reporter: gal, Assigned: gal)

References

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file, 1 obsolete file)

Detecting a shutdown via JSRS_LANDING is too late and won't allow the CC to collect some objects.
Attached patch patch (obsolete) (deleted) — Splinter Review
Assignee: general → gal
Blocks: 506117
This fixes the shutdown leak.
Attached patch commence ftw! (deleted) — Splinter Review
Attachment #395173 - Attachment is obsolete: true
Fixed CommenceShutDown -> CommenceRuntimeShutDown.
Comment on attachment 395186 [details] [diff] [review] commence ftw! Mr. Hutchinson: Is it possible for me to reserve the BBC 2 channel for the duration of this televisual feast? Basil Fawlty: Why don't you talk properly? Mr. Hutchinson: I beg your pardon? Basil Fawlty: No. It isn't. Mr. Hutchinson: What? Basil Fawlty: It is not possible to reserve the BBC 2 channel from the commencement of this "televisual feast" until the moment of the termination of its ending, thank you so much. Clearly we need JS_CommenceMomentOfTerminationOfEnding() :-P. /be
Attachment #395186 - Flags: review+
Whiteboard: fixed-in-tracemonkey
ok, so I can confirm that we don't leak if I always do flush() in mark(). Will try to work backwards from here trying to figure out when to flip the switch during the shutdown sequence.
Ok, this leaks _sometimes_: --DOCSHELL 0x1cfb5dd0 == 6 --DOCSHELL 0x1cfb7f00 == 5 WARNING: NS_ENSURE_SUCCESS(rv, 0) failed with result 0x8000FFFF: file ../../../../content/base/src/nsContentUtils.cpp, line 2727 JavaScript error: chrome://browser/content/browser.js, line 9190: this._observerService is null --DOCSHELL 0x17922fb0 == 4 XXX mark --DOMWINDOW == 15 (0x156bde00) [serial = 17] [outer = 0x1d7a4f10] [url = http://www.mozilla.org/newlayout/samples/test8.html] --DOMWINDOW == 14 (0x1fc0e700) [serial = 18] [outer = 0x1d7a4f10] [url = http://www.mozilla.org/newlayout/samples/test6.html] --DOMWINDOW == 13 (0x1cfb62c0) [serial = 5] [outer = 0x0] [url = about:blank] --DOMWINDOW == 12 (0x1cfb8390) [serial = 6] [outer = 0x0] [url = about:blank] --DOMWINDOW == 11 (0x1d4ba250) [serial = 7] [outer = 0x0] [url = http://localhost:8888/bloatcycle.html] --DOCSHELL 0x1d4b9ba0 == 3 --DOMWINDOW == 10 (0x1fbd5a90) [serial = 19] [outer = 0x1d7a4f10] [url = http://www.mozilla.org/newlayout/samples/test8.html] --DOCSHELL 0x17946570 == 2 --DOMWINDOW == 9 (0x1d70b700) [serial = 8] [outer = 0x0] [url = about:blank] --DOMWINDOW == 8 (0x1d70e1d0) [serial = 9] [outer = 0x0] [url = about:blank] --DOMWINDOW == 7 (0x1d78ea60) [serial = 11] [outer = 0x0] [url = http://localhost:8888/bloatcycle.html] --DOMWINDOW == 6 (0x1d7a4f40) [serial = 12] [outer = 0x0] [url = http://www.mozilla.org/newlayout/samples/test8.html] --DOCSHELL 0x1d7a4a10 == 1 --DOMWINDOW == 5 (0x20ac3bc0) [serial = 15] [outer = 0x0] [url = http://www.mozilla.org/] --DOMWINDOW == 4 (0x1ae50eb0) [serial = 16] [outer = 0x0] [url = http://www.mozilla.org/newlayout/samples/test2.html] WARNING: nsAppShell::Exit() called redundantly: file ../../../../widget/src/cocoa/nsAppShell.mm, line 782 WARNING: nsExceptionService ignoring thread destruction after shutdown: file ../../../xpcom/base/nsExceptionService.cpp, line 194 XXX mark WARNING: not an nsIRDFRemoteDataSource: 'remote != nsnull', file ../../../../rdf/datasource/src/nsLocalStore.cpp, line 312 --DOMWINDOW == 3 (0x8384d0) [serial = 4] [outer = 0x17934680] [url = chrome://browser/content/hiddenWindow.xul] --DOMWINDOW == 2 (0x179346b0) [serial = 1] [outer = 0x0] [url = chrome://browser/content/hiddenWindow.xul] XXX mark XXX mark XXX mark WARNING: Textrun cache not empty!: 'mCache.Count() == 0', file ../../../../gfx/thebes/src/gfxTextRunWordCache.cpp, line 85 WARNING: Fonts still alive while shutting down gfxFontCache: 'mFonts.Count() == 0', file ../../../dist/include/gfxFont.h, line 275 Assertion failed at ../../../../../gfx/cairo/cairo/src/cairo-hash.c:198: hash_table->live_entries == 0 WARNING: Leaking the RDF Service.: file ../../../rdf/build/nsRDFModule.cpp, line 236 == BloatView: ALL (cumulative) LEAK AND BLOAT STATISTICS |<----------------Class--------------->|<-----Bytes------>|<----------------Objects---------------->|<--------------References-------------->| Per-Inst Leaked Total Rem Mean StdDev Total Rem Mean StdDev 0 TOTAL 30 1086207 1029860 38390 ( 2880.88 +/- 3181.50) 2012274 26258 ( 1701.80 +/- 2847.76) 1 AsyncExecuteStatements 64 0 3 0 ( 0.83 +/- 0.75) 18 0 ( 2.89 +/- 1.53) 2 AtomImpl 20 23720 2087 1186 ( 980.60 +/- 419.95) 42705 4260 ( 6154.99 +/- 1849.07) 3 BackstagePass 24 24 1 1 ( 1.00 +/- 0.00) 72400 94 ( 193.46 +/- 27.70) Other times we hit the commence hook and then don't leak: --DOCSHELL 0x1d8c8f10 == 1 --DOMWINDOW == 6 (0x1d8d1dc0) [serial = 13] [outer = 0x0] [url = about:blank] --DOMWINDOW == 5 (0x1d5d63a0) [serial = 7] [outer = 0x0] [url = http://localhost:8888/bloatcycle.html] --DOMWINDOW == 4 (0x1e934e20) [serial = 14] [outer = 0x0] [url = http://www.mozilla.org/] WARNING: nsAppShell::Exit() called redundantly: file ../../../../widget/src/cocoa/nsAppShell.mm, line 782 WARNING: nsExceptionService ignoring thread destruction after shutdown: file ../../../xpcom/base/nsExceptionService.cpp, line 194 XXX marking WARNING: NS_ENSURE_TRUE(factory) failed: file ../../../docshell/base/nsDocShell.cpp, line 9853 --DOCSHELL 0x1d5c8070 == 0 --DOMWINDOW == 3 (0x1795d660) [serial = 3] [outer = 0x1794ca20] [url = about:blank] WARNING: not an nsIRDFRemoteDataSource: 'remote != nsnull', file ../../../../rdf/datasource/src/nsLocalStore.cpp, line 312 --DOMWINDOW == 2 (0x1794ca50) [serial = 2] [outer = 0x0] [url = chrome://browser/content/browser.xul] --DOMWINDOW == 1 (0x1793a0a0) [serial = 1] [outer = 0x0] [url = chrome://browser/content/hiddenWindow.xul] WARNING: not an nsIRDFRemoteDataSource: 'remote != nsnull', file ../../../../rdf/datasource/src/nsLocalStore.cpp, line 312 --DOMWINDOW == 0 (0x83cc20) [serial = 4] [outer = 0x0] [url = chrome://browser/content/hiddenWindow.xul] XXX marking XXX marking XXX commence XXX flushing XXX flushing == BloatView: ALL (cumulative) LEAK AND BLOAT STATISTICS |<----------------Class--------------->|<-----Bytes------>|<----------------Objects---------------->|<--------------References-------------->| Per-Inst Leaked Total Rem Mean StdDev Total Rem Mean StdDev 0 TOTAL 41 0 319981 0 ( 1177.23 +/- 1867.84) 932606 0 ( 1205.15 +/- 1830.17) 1 AsyncExecuteStatements 64 0 2 0 ( 1.00 +/- 0.82) 12 0 ( 3.25 +/- 1.59) 2 AtomImpl 20 0 1852 0 ( 801.99 +/- 416.79) 17351 0 ( 4001.47 +/- 1776.35) 3 BackstagePass 24 0 1 0 ( 0.50 +/- 0.71) 26612 0 ( 182.78 +/- 44.13)
Depends on: 511522
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: