With the fix for bugs 189147 and bug 189459, svg/text/text-text-05-t.svg still leaks.
<rdar://problem/44269848>
This is going to be another retain cycle involving SVGFontFaceElement.
Also involves: 3 0x3977b3d24 WTF::RefPtr<WebCore::SVGFontFaceElement, WTF::DumbPtrTraits<WebCore::SVGFontFaceElement> >::RefPtr(WebCore::SVGFontFaceElement*) 4 0x39778c25d WTF::RefPtr<WebCore::SVGFontFaceElement, WTF::DumbPtrTraits<WebCore::SVGFontFaceElement> >::RefPtr(WebCore::SVGFontFaceElement*) 5 0x39778c006 WebCore::CSSFontFaceSource::CSSFontFaceSource(WebCore::CSSFontFace&, WTF::String const&, WebCore::CachedFont*, WebCore::SVGFontFaceElement*, WTF::RefPtr<JSC::ArrayBufferView, WTF::DumbPtrTraits<JSC::ArrayBufferView> >&&) 6 0x39778c50d WebCore::CSSFontFaceSource::CSSFontFaceSource(WebCore::CSSFontFace&, WTF::String const&, WebCore::CachedFont*, WebCore::SVGFontFaceElement*, WTF::RefPtr<JSC::ArrayBufferView, WTF::DumbPtrTraits<JSC::ArrayBufferView> >&&) 7 0x39777ce66 WebCore::CSSFontFace::appendSources(WebCore::CSSFontFace&, WebCore::CSSValueList&, WebCore::Document*, bool) 8 0x39778f1bd WebCore::CSSFontSelector::addFontFaceRule(WebCore::StyleRuleFontFace&, bool) 9 0x39778e73d WebCore::CSSFontSelector::buildCompleted() 10 0x39900b4f5 WebCore::Style::Scope::resolver() 11 0x399011e11 WebCore::Style::TreeResolver::Scope::Scope(WebCore::Document&) 12 0x399011ecd WebCore::Style::TreeResolver::Scope::Scope(WebCore::Document&) 13 0x399017cfa WebCore::Style::TreeResolver::resolve() 14 0x397a298e7 WebCore::Document::resolveStyle(WebCore::Document::ResolveStyleType) 15 0x397a2b423 WebCore::Document::updateStyleIfNeeded() 16 0x397a441f7 WebCore::Document::finishedParsing()
Looks like in a manual test no documents are leaking, or at least this looks as I would expect it to look. 1. Launch MiniBrowser (webkit.org) 2. Load the test page (file:///...) 3. Navigate to about:blank 4. Take measurements > $ notifyutil -p com.apple.WebKit.showAllDocuments > 81081 6 live pages: > 81081 Page 0x6d6dbf100 with main document 0x6eb4020f0 > 81081 Page 0x6d6df9b00 with main document 0x6ea201078 > 81081 Page 0x6d6dbd000 with main document 0x6eb601078 > 81081 Page 0x6d6dbdb00 with main document 0x6ea2020f0 > 81081 Page 0x6d6df9000 with main document 0x6ea302180 about:blank > 81081 Page 0x6d6dbe600 with main document 0x6eb401078 > 81081 8 live documents: > 81081 SVGDocument 0x6eb601078 12 (refCount 1, referencingNodeCount 8) > 81081 SVGDocument 0x6eb4020f0 10 (refCount 1, referencingNodeCount 13) > 81081 SVGDocument 0x6eb6020f0 13 (refCount 3, referencingNodeCount 1018) .../LayoutTests/svg/text/text-text-05-t.svg > 81081 SVGDocument 0x6eb401078 8 (refCount 1, referencingNodeCount 5) > 81081 SVGDocument 0x6ea201078 4 (refCount 1, referencingNodeCount 9) > 81081 SVGDocument 0x6ea2020f0 6 (refCount 1, referencingNodeCount 45) > 81081 Document 0x6d68010c0 2 (refCount 6, referencingNodeCount 684) https://webkit.org/ > 81081 Document 0x6ea302180 14 (refCount 2, referencingNodeCount 3) about:blank > > $ notifyutil -p org.WebKit.lowMemory > 81081 Memory pressure relief: Total: res = 28389376/25059328/-3330048, res+swap = 26914816/23584768/-3330048 > > > $ notifyutil -p com.apple.WebKit.showAllDocuments > 81081 1 live pages: > 81081 Page 0x6d6df9000 with main document 0x6ea302180 about:blank > 81081 1 live documents: > 81081 Document 0x6ea302180 14 (refCount 2, referencingNodeCount 3) about:blank Next step: • Investigate when the Document gets released and ensure that `run-webkit-tests --world-leaks` doesn't have a false report for this.
In MiniBrowser I see the document (SVGDocument here) going away with a memory warning when the FontCascadeCache gets purged: > >>> Document::~Document - 0x7833020f0 > 1 0x7522f4a40 WebCore::Document::~Document() > 2 0x7522d4a95 WebCore::XMLDocument::~XMLDocument() > 3 0x753aa4325 WebCore::SVGDocument::~SVGDocument() > 4 0x753a917e5 WebCore::SVGDocument::~SVGDocument() > 5 0x753a91809 WebCore::SVGDocument::~SVGDocument() > 6 0x7522f70e2 WebCore::Document::decrementReferencingNodeCount() > 7 0x752455689 WebCore::Node::~Node() > 8 0x7522a3b17 WebCore::ContainerNode::~ContainerNode() > 9 0x7523bab1b WebCore::Element::~Element() > 10 0x752502e32 WebCore::StyledElement::~StyledElement() > 11 0x753a86129 WebCore::SVGElement::~SVGElement() > 12 0x753b537bd WebCore::SVGFontFaceElement::~SVGFontFaceElement() > 13 0x753b537e5 WebCore::SVGFontFaceElement::~SVGFontFaceElement() > 14 0x753b53809 WebCore::SVGFontFaceElement::~SVGFontFaceElement() > 15 0x75246192b WebCore::Node::removedLastRef() > 16 0x75002478d WebCore::Node::deref() > 17 0x75208b5c1 void WTF::derefIfNotNull<WebCore::SVGFontFaceElement>(WebCore::SVGFontFaceElement*) > 18 0x75208b589 WTF::RefPtr<WebCore::SVGFontFaceElement, WTF::DumbPtrTraits<WebCore::SVGFontFaceElement> >::~RefPtr() > 19 0x75206a0e5 WTF::RefPtr<WebCore::SVGFontFaceElement, WTF::DumbPtrTraits<WebCore::SVGFontFaceElement> >::~RefPtr() > 20 0x75206a03f WebCore::CSSFontFaceSource::~CSSFontFaceSource() > ... > 33 0x75204c939 WebCore::CSSFontFace::~CSSFontFace() > ... > 61 0x753120305 WebCore::FontCascadeCacheEntry::~FontCascadeCacheEntry() > ... > 71 0x7531086b9 WebCore::pruneUnreferencedEntriesFromFontCascadeCache() > 72 0x753108107 WebCore::FontCache::purgeInactiveFontData(unsigned int) > 73 0x752e77309 WebCore::releaseNoncriticalMemory() > 74 0x752e76f81 WebCore::releaseMemory(WTF::Critical, WTF::Synchronous, WebCore::MaintainPageCache) > 75 0x10a394f48 WebKit::WebProcess::initializeWebProcess(WebKit::WebProcessCreationParameters&&)::$_4::operator()(WTF::Critical, WTF::Synchronous) const > 76 0x10a394ec6 WTF::Function<void (WTF::Critical, WTF::Synchronous)>::CallableWrapper<WebKit::WebProcess::initializeWebProcess(WebKit::WebProcessCreationParameters&&)::$_4>::call(WTF::Critical, WTF::Synchronous) > 77 0x7673f7a94 WTF::Function<void (WTF::Critical, WTF::Synchronous)>::operator()(WTF::Critical, WTF::Synchronous) const > 78 0x7673f75ae WTF::MemoryPressureHandler::releaseMemory(WTF::Critical, WTF::Synchronous) > 79 0x7673f9938 WTF::MemoryPressureHandler::respondToMemoryPressure(WTF::Critical, WTF::Synchronous) > 80 0x7673f7935 WTF::MemoryPressureHandler::beginSimulatedMemoryPressure() > 81 0x7673f99d6 invocation function for block in WTF::MemoryPressureHandler::install()
It is interesting to note that `WebCore::FontCache::purgeInactiveFontData` purges differently in a memory warning versus WKBundleReleaseMemory based on being under real memory pressure or not: const unsigned cMaxInactiveFontData = 225; const unsigned cMaxUnderMemoryPressureInactiveFontData = 50; ... void FontCache::purgeInactiveFontDataIfNeeded() { bool underMemoryPressure = MemoryPressureHandler::singleton().isUnderMemoryPressure(); unsigned inactiveFontDataLimit = underMemoryPressure ? cMaxUnderMemoryPressureInactiveFontData : cMaxInactiveFontData; ... } So a MemoryWarning (which will simulate isUnderMemoryPressure) will potentially reduce the cache to 50 but a simple WKBundleReleaseMemory would aim for 225. I'll see if I force WKBundleReleaseMemory to set "isUnderMemoryPressure" if that helps.
That wasn't enough. The SVG Document is still not getting released in tests (and still not even if I purge inactive as much as possible). So it seems this font is probably considered active at the end of the test. That is what I'll start looking at next.
Oops, that was `FontCache::purgeInactiveFontDataIfNeeded` not `FontCache::purgeInactiveFontData`, so of course it didn't matter. Still, it is probably a good thing to make WKBundleReleaseMemory simulate a memory warning / act as if we are under memory pressure to release as much as possible. This is only used by tests anyways.
When I remove the LayoutTest specific part of this test: ``` if (window.testRunner) testRunner.dumpSelectionRect(); ``` The test doesn't abandon a document.
Actually the other JavaScript: function repaintTest() { document.execCommand("SelectAll"); } This might make sense because often the selection goes away in MiniBrowser.
Dumping the FontCascade cache, there is a single entry which is different (and has more refs).
Looks like in LayoutTests the FontCascadeFonts is held onto by the FontCascade inside of the document's StyleResolver: >>> FontCascadeFonts::FontCascadeFonts(FontSelector) - 0x3ee2805a0 (1) 1 0x3d2aa1386 WebCore::FontCascadeFonts::FontCascadeFonts(WTF::RefPtr<WebCore::FontSelector, WTF::DumbPtrTraits<WebCore::FontSelector> >&&) 2 0x3d2aa151d WebCore::FontCascadeFonts::FontCascadeFonts(WTF::RefPtr<WebCore::FontSelector, WTF::DumbPtrTraits<WebCore::FontSelector> >&&) 3 0x3d2aabc2f WebCore::FontCascadeFonts::create(WTF::RefPtr<WebCore::FontSelector, WTF::DumbPtrTraits<WebCore::FontSelector> >&&) 4 0x3d2a984f3 WebCore::retrieveOrAddCachedFonts(WebCore::FontCascadeDescription const&, WTF::RefPtr<WebCore::FontSelector, WTF::DumbPtrTraits<WebCore::FontSelector> >&&) 5 0x3d2a9831f WebCore::FontCascade::update(WTF::RefPtr<WebCore::FontSelector, WTF::DumbPtrTraits<WebCore::FontSelector> >&&) const 6 0x3d1b18b19 WebCore::StyleResolver::updateFont() 7 0x3d1b16d55 WebCore::StyleResolver::applyMatchedProperties(WebCore::StyleResolver::MatchResult const&, WebCore::Element const&, WebCore::StyleResolver::ShouldUseMatchedPropertiesCache) 8 0x3d1b0aeea WebCore::StyleResolver::styleForElement(WebCore::Element const&, WebCore::RenderStyle const*, WebCore::RenderStyle const*, WebCore::RuleMatchingBehavior, WebCore::SelectorFilter const*) 9 0x3d1d5181f WebCore::Element::resolveStyle(WebCore::RenderStyle const*) 10 0x3d341c2ef WebCore::SVGElement::resolveCustomStyle(WebCore::RenderStyle const&, WebCore::RenderStyle const*) 11 0x3d3346bd2 WebCore::Style::TreeResolver::styleForElement(WebCore::Element&, WebCore::RenderStyle const&) 12 0x3d33471f0 WebCore::Style::TreeResolver::resolveElement(WebCore::Element&) 13 0x3d3348af9 WebCore::Style::TreeResolver::resolveComposedTree() 14 0x3d33498b8 WebCore::Style::TreeResolver::resolve() 15 0x3d1c8c77a WebCore::Document::resolveStyle(WebCore::Document::ResolveStyleType) 16 0x3d1c8d9bd WebCore::Document::updateStyleIfNeeded() 17 0x3d1ca5730 WebCore::Document::finishedParsing() 18 0x3d3816fe4 WebCore::XMLDocumentParser::end() 19 0x3d38176ea WebCore::XMLDocumentParser::resumeParsing() 20 0x3d38174ac WebCore::XMLDocumentParser::notifyFinished(WebCore::PendingScript&) 21 0x3d1e0a307 WebCore::PendingScript::notifyClientFinished() 22 0x3d1e0a369 WebCore::PendingScript::notifyFinished(WebCore::LoadableScript&) 23 0x3d1da8ac6 WebCore::LoadableScript::notifyClientFinished() 24 0x3d1da88b0 WebCore::LoadableClassicScript::notifyFinished(WebCore::CachedResource&) 25 0x3d26d527f WebCore::CachedResource::checkNotify() 26 0x3d26d0591 WebCore::CachedResource::finishLoading(WebCore::SharedBuffer*) 27 0x3d26fe9df WebCore::CachedScript::finishLoading(WebCore::SharedBuffer*) 28 0x3d2650971 WebCore::SubresourceLoader::didFinishLoading(WebCore::NetworkLoadMetrics const&) 29 0x3c8ddef93 WebKit::WebResourceLoader::didFinishResourceLoad(WebCore::NetworkLoadMetrics const&) 30 0x3c917c1fa void IPC::callMemberFunctionImpl<WebKit::WebResourceLoader, void (WebKit::WebResourceLoader::*)(WebCore::NetworkLoadMetrics const&), std::__1::tuple<WebCore::NetworkLoadMetrics>, 0ul>(WebKit::WebResourceLoader*, void (WebKit::WebResourceLoader::*)(WebCore::NetworkLoadMetrics const&), std::__1::tuple<WebCore::NetworkLoadMetrics>&&, std::__1::integer_sequence<unsigned long, 0ul>) 31 0x3c917bfb0 void IPC::callMemberFunction<WebKit::WebResourceLoader, void (WebKit::WebResourceLoader::*)(WebCore::NetworkLoadMetrics const&), std::__1::tuple<WebCore::NetworkLoadMetrics>, std::__1::integer_sequence<unsigned long, 0ul> >(std::__1::tuple<WebCore::NetworkLoadMetrics>&&, WebKit::WebResourceLoader*, void (WebKit::WebResourceLoader::*)(WebCore::NetworkLoadMetrics const&)) >>> FontCascadeFonts::ref - 0x3ee2805a0 (2) 1 0x3d2aa1974 WebCore::FontCascadeFonts::ref() const 2 0x3d2aadf84 WTF::Ref<WebCore::FontCascadeFonts, WTF::DumbPtrTraits<WebCore::FontCascadeFonts> >::Ref(WebCore::FontCascadeFonts&) 3 0x3d2aabb3d WTF::Ref<WebCore::FontCascadeFonts, WTF::DumbPtrTraits<WebCore::FontCascadeFonts> >::Ref(WebCore::FontCascadeFonts&) 4 0x3d2a98566 WebCore::retrieveOrAddCachedFonts(WebCore::FontCascadeDescription const&, WTF::RefPtr<WebCore::FontSelector, WTF::DumbPtrTraits<WebCore::FontSelector> >&&) 5 0x3d2a9831f WebCore::FontCascade::update(WTF::RefPtr<WebCore::FontSelector, WTF::DumbPtrTraits<WebCore::FontSelector> >&&) const 6 0x3d1b18b19 WebCore::StyleResolver::updateFont() 7 0x3d1b16d55 WebCore::StyleResolver::applyMatchedProperties(WebCore::StyleResolver::MatchResult const&, WebCore::Element const&, WebCore::StyleResolver::ShouldUseMatchedPropertiesCache) 8 0x3d1b0aeea WebCore::StyleResolver::styleForElement(WebCore::Element const&, WebCore::RenderStyle const*, WebCore::RenderStyle const*, WebCore::RuleMatchingBehavior, WebCore::SelectorFilter const*) 9 0x3d1d5181f WebCore::Element::resolveStyle(WebCore::RenderStyle const*) 10 0x3d341c2ef WebCore::SVGElement::resolveCustomStyle(WebCore::RenderStyle const&, WebCore::RenderStyle const*) 11 0x3d3346bd2 WebCore::Style::TreeResolver::styleForElement(WebCore::Element&, WebCore::RenderStyle const&) 12 0x3d33471f0 WebCore::Style::TreeResolver::resolveElement(WebCore::Element&) 13 0x3d3348af9 WebCore::Style::TreeResolver::resolveComposedTree() 14 0x3d33498b8 WebCore::Style::TreeResolver::resolve() 15 0x3d1c8c77a WebCore::Document::resolveStyle(WebCore::Document::ResolveStyleType) 16 0x3d1c8d9bd WebCore::Document::updateStyleIfNeeded() 17 0x3d1ca5730 WebCore::Document::finishedParsing() 18 0x3d3816fe4 WebCore::XMLDocumentParser::end() 19 0x3d38176ea WebCore::XMLDocumentParser::resumeParsing() 20 0x3d38174ac WebCore::XMLDocumentParser::notifyFinished(WebCore::PendingScript&) 21 0x3d1e0a307 WebCore::PendingScript::notifyClientFinished() 22 0x3d1e0a369 WebCore::PendingScript::notifyFinished(WebCore::LoadableScript&) 23 0x3d1da8ac6 WebCore::LoadableScript::notifyClientFinished() 24 0x3d1da88b0 WebCore::LoadableClassicScript::notifyFinished(WebCore::CachedResource&) 25 0x3d26d527f WebCore::CachedResource::checkNotify() 26 0x3d26d0591 WebCore::CachedResource::finishLoading(WebCore::SharedBuffer*) 27 0x3d26fe9df WebCore::CachedScript::finishLoading(WebCore::SharedBuffer*) 28 0x3d2650971 WebCore::SubresourceLoader::didFinishLoading(WebCore::NetworkLoadMetrics const&) 29 0x3c8ddef93 WebKit::WebResourceLoader::didFinishResourceLoad(WebCore::NetworkLoadMetrics const&) 30 0x3c917c1fa void IPC::callMemberFunctionImpl<WebKit::WebResourceLoader, void (WebKit::WebResourceLoader::*)(WebCore::NetworkLoadMetrics const&), std::__1::tuple<WebCore::NetworkLoadMetrics>, 0ul>(WebKit::WebResourceLoader*, void (WebKit::WebResourceLoader::*)(WebCore::NetworkLoadMetrics const&), std::__1::tuple<WebCore::NetworkLoadMetrics>&&, std::__1::integer_sequence<unsigned long, 0ul>) 31 0x3c917bfb0 void IPC::callMemberFunction<WebKit::WebResourceLoader, void (WebKit::WebResourceLoader::*)(WebCore::NetworkLoadMetrics const&), std::__1::tuple<WebCore::NetworkLoadMetrics>, std::__1::integer_sequence<unsigned long, 0ul> >(std::__1::tuple<WebCore::NetworkLoadMetrics>&&, WebKit::WebResourceLoader*, void (WebKit::WebResourceLoader::*)(WebCore::NetworkLoadMetrics const&)) >>> FontCascadeFonts::ref - 0x3ee2805a0 (3) 1 0x3d2aa1974 WebCore::FontCascadeFonts::ref() const 2 0x3d2aadf84 WTF::Ref<WebCore::FontCascadeFonts, WTF::DumbPtrTraits<WebCore::FontCascadeFonts> >::Ref(WebCore::FontCascadeFonts&) 3 0x3d2aabb3d WTF::Ref<WebCore::FontCascadeFonts, WTF::DumbPtrTraits<WebCore::FontCascadeFonts> >::Ref(WebCore::FontCascadeFonts&) 4 0x3d2a984a2 WebCore::retrieveOrAddCachedFonts(WebCore::FontCascadeDescription const&, WTF::RefPtr<WebCore::FontSelector, WTF::DumbPtrTraits<WebCore::FontSelector> >&&) 5 0x3d2a9831f WebCore::FontCascade::update(WTF::RefPtr<WebCore::FontSelector, WTF::DumbPtrTraits<WebCore::FontSelector> >&&) const 6 0x3d3274f03 WebCore::RenderSVGInlineText::computeNewScaledFontForStyle(WebCore::RenderObject const&, WebCore::RenderStyle const&, float&, WebCore::FontCascade&) 7 0x3d3273dc0 WebCore::RenderSVGInlineText::updateScaledFont() .. >>> FontCascadeFonts::deref - 0x3ee2805a0 (2) 1 0x3d2aa19e4 WebCore::FontCascadeFonts::deref() const 2 0x3d228c6de void WTF::derefIfNotNull<WebCore::FontCascadeFonts>(WebCore::FontCascadeFonts*) 3 0x3d228c6a9 WTF::RefPtr<WebCore::FontCascadeFonts, WTF::DumbPtrTraits<WebCore::FontCascadeFonts> >::~RefPtr() 4 0x3d228c655 WTF::RefPtr<WebCore::FontCascadeFonts, WTF::DumbPtrTraits<WebCore::FontCascadeFonts> >::~RefPtr() 5 0x3d2a97969 WTF::RefPtr<WebCore::FontCascadeFonts, WTF::DumbPtrTraits<WebCore::FontCascadeFonts> >::operator=(WTF::RefPtr<WebCore::FontCascadeFonts, WTF::DumbPtrTraits<WebCore::FontCascadeFonts> > const&) 6 0x3d2a97853 WebCore::FontCascade::operator=(WebCore::FontCascade const&) 7 0x3d3274eaf WebCore::RenderSVGInlineText::computeNewScaledFontForStyle(WebCore::RenderObject const&, WebCore::RenderStyle const&, float&, WebCore::FontCascade&) 8 0x3d3273dc0 WebCore::RenderSVGInlineText::updateScaledFont() ... >>> pruneUnreferencedEntriesFromFontCascadeCache >>> ... >>> ENTRY: 0x3ee2805a0 [2] [custom font] In MiniBrowser the StyleResolver / FontCascade / FontCascadeFonts get destroyed as part of releaseMemory: static void releaseCriticalMemory(Synchronous synchronous, MaintainPageCache maintainPageCache) { ... for (auto& document : copyToVectorOf<RefPtr<Document>>(Document::allDocuments())) { document->styleScope().releaseMemory(); document->fontSelector().emptyCaches(); document->cachedResourceLoader().garbageCollectDocumentResources(); } ... } -------- void Scope::clearResolver() { m_resolver = nullptr; if (!m_shadowRoot) m_document.didClearStyleResolver(); } void Scope::releaseMemory() { if (!m_shadowRoot) { for (auto* descendantShadowRoot : m_document.inDocumentShadowRoots()) descendantShadowRoot->styleScope().releaseMemory(); } #if ENABLE(CSS_SELECTOR_JIT) for (auto& sheet : m_activeStyleSheets) { sheet->contents().traverseRules([] (const StyleRuleBase& rule) { if (is<StyleRule>(rule)) downcast<StyleRule>(rule).releaseCompiledSelectors(); return false; }); } #endif clearResolver(); } -------- >>> FontCascadeFonts::deref - 0x441be1a20 (1) 1 0x4231139e4 WebCore::FontCascadeFonts::deref() const 2 0x4228fe6de void WTF::derefIfNotNull<WebCore::FontCascadeFonts>(WebCore::FontCascadeFonts*) 3 0x4228fe6a9 WTF::RefPtr<WebCore::FontCascadeFonts, WTF::DumbPtrTraits<WebCore::FontCascadeFonts> >::~RefPtr() 4 0x4228fe655 WTF::RefPtr<WebCore::FontCascadeFonts, WTF::DumbPtrTraits<WebCore::FontCascadeFonts> >::~RefPtr() 5 0x4228fe613 WebCore::FontCascade::~FontCascade() 6 0x4228ecfc5 WebCore::FontCascade::~FontCascade() 7 0x4238bb5a7 WebCore::StyleInheritedData::~StyleInheritedData() 8 0x4238bb535 WebCore::StyleInheritedData::~StyleInheritedData() 9 0x4238bb507 WTF::RefCounted<WebCore::StyleInheritedData>::deref() const 10 0x4238bb48f WTF::Ref<WebCore::StyleInheritedData, WTF::DumbPtrTraits<WebCore::StyleInheritedData> >::~Ref() 11 0x42389c3a5 WTF::Ref<WebCore::StyleInheritedData, WTF::DumbPtrTraits<WebCore::StyleInheritedData> >::~Ref() 12 0x4238b2035 WebCore::DataRef<WebCore::StyleInheritedData>::~DataRef() 13 0x42389c5b5 WebCore::DataRef<WebCore::StyleInheritedData>::~DataRef() 14 0x42389c4fb WebCore::RenderStyle::~RenderStyle() 15 0x42389b145 WebCore::RenderStyle::~RenderStyle() 16 0x42219f0ab std::__1::default_delete<WebCore::RenderStyle>::operator()(WebCore::RenderStyle*) const 17 0x42219f02f std::__1::unique_ptr<WebCore::RenderStyle, std::__1::default_delete<WebCore::RenderStyle> >::reset(WebCore::RenderStyle*) 18 0x4221a9759 std::__1::unique_ptr<WebCore::RenderStyle, std::__1::default_delete<WebCore::RenderStyle> >::~unique_ptr() 19 0x42217d055 std::__1::unique_ptr<WebCore::RenderStyle, std::__1::default_delete<WebCore::RenderStyle> >::~unique_ptr() 20 0x4221a2e13 WebCore::StyleResolver::MatchedPropertiesCacheItem::~MatchedPropertiesCacheItem() 21 0x42218f1a5 WebCore::StyleResolver::MatchedPropertiesCacheItem::~MatchedPropertiesCacheItem() 22 0x42219df69 WTF::KeyValuePair<unsigned int, WebCore::StyleResolver::MatchedPropertiesCacheItem>::~KeyValuePair() 23 0x42219df35 WTF::KeyValuePair<unsigned int, WebCore::StyleResolver::MatchedPropertiesCacheItem>::~KeyValuePair() 24 0x42219deca WTF::HashTable<unsigned int, WTF::KeyValuePair<unsigned int, WebCore::StyleResolver::MatchedPropertiesCacheItem>, WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<unsigned int, WebCore::StyleResolver::MatchedPropertiesCacheItem> >, WTF::IntHash<unsigned int>, WTF::HashMap<unsigned int, WebCore::StyleResolver::MatchedPropertiesCacheItem, WTF::IntHash<unsigned int>, WTF::HashTraits<unsigned int>, WTF::HashTraits<WebCore::StyleResolver::MatchedPropertiesCacheItem> >::KeyValuePairTraits, WTF::HashTraits<unsigned int> >::deallocateTable(WTF::KeyValuePair<unsigned int, WebCore::StyleResolver::MatchedPropertiesCacheItem>*, unsigned int) 25 0x42219dda6 WTF::HashTable<unsigned int, WTF::KeyValuePair<unsigned int, WebCore::StyleResolver::MatchedPropertiesCacheItem>, WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<unsigned int, WebCore::StyleResolver::MatchedPropertiesCacheItem> >, WTF::IntHash<unsigned int>, WTF::HashMap<unsigned int, WebCore::StyleResolver::MatchedPropertiesCacheItem, WTF::IntHash<unsigned int>, WTF::HashTraits<unsigned int>, WTF::HashTraits<WebCore::StyleResolver::MatchedPropertiesCacheItem> >::KeyValuePairTraits, WTF::HashTraits<unsigned int> >::~HashTable() 26 0x42219dd65 WTF::HashTable<unsigned int, WTF::KeyValuePair<unsigned int, WebCore::StyleResolver::MatchedPropertiesCacheItem>, WTF::KeyValuePairKeyExtractor<WTF::KeyValuePair<unsigned int, WebCore::StyleResolver::MatchedPropertiesCacheItem> >, WTF::IntHash<unsigned int>, WTF::HashMap<unsigned int, WebCore::StyleResolver::MatchedPropertiesCacheItem, WTF::IntHash<unsigned int>, WTF::HashTraits<unsigned int>, WTF::HashTraits<WebCore::StyleResolver::MatchedPropertiesCacheItem> >::KeyValuePairTraits, WTF::HashTraits<unsigned int> >::~HashTable() 27 0x42219dd45 WTF::HashMap<unsigned int, WebCore::StyleResolver::MatchedPropertiesCacheItem, WTF::IntHash<unsigned int>, WTF::HashTraits<unsigned int>, WTF::HashTraits<WebCore::StyleResolver::MatchedPropertiesCacheItem> >::~HashMap() 28 0x422187915 WTF::HashMap<unsigned int, WebCore::StyleResolver::MatchedPropertiesCacheItem, WTF::IntHash<unsigned int>, WTF::HashTraits<unsigned int>, WTF::HashTraits<WebCore::StyleResolver::MatchedPropertiesCacheItem> >::~HashMap() 29 0x42218787e WebCore::StyleResolver::~StyleResolver() 30 0x422187955 WebCore::StyleResolver::~StyleResolver() 31 0x4239c3cbb std::__1::default_delete<WebCore::StyleResolver>::operator()(WebCore::StyleResolver*) const Next up I have to check which documents releaseCriticalMemory acted on, and if the StyleResolver is getting destroyed. If they do, then understanding whats happening with a RenderStyle that didn't release the FontCascade / FontCascadeFonts.
Fixing this in the bug 196059. *** This bug has been marked as a duplicate of bug 196059 ***