<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>188399</bug_id>
          
          <creation_ts>2018-08-07 19:31:11 -0700</creation_ts>
          <short_desc>Web Inspector: Consider raising the 4gb process memory limit for WebInspector process</short_desc>
          <delta_ts>2020-08-27 14:13:40 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Web Inspector</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Saam Barati">saam</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>bburg</cc>
    
    <cc>inspector-bugzilla-changes</cc>
    
    <cc>joepeck</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1448662</commentid>
    <comment_count>0</comment_count>
    <who name="Saam Barati">saam</who>
    <bug_when>2018-08-07 19:31:11 -0700</bug_when>
    <thetext>I ran into this limit a few times when taking heap snapshots of large heaps.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1448865</commentid>
    <comment_count>1</comment_count>
    <who name="Joseph Pecoraro">joepeck</who>
    <bug_when>2018-08-08 15:14:06 -0700</bug_when>
    <thetext>In WebKit the Web Inspector frontend page is just a WebPageProxy:

    void WebInspectorProxy::createFrontendPage()
    {
        if (m_inspectorPage)
            return;

        m_inspectorPage = platformCreateFrontendPage();
        ...
        trackInspectorPage(m_inspectorPage);
        ...
    }


However these inspector frontend pages are put into special WebProcessPools meant for only Inspector Pages:

    WebProcessPool&amp; inspectorProcessPool(unsigned inspectionLevel)
    {
        // Having our own process pool removes us from the main process pool and
        // guarantees no process sharing for our user interface.
        WebProcessPool*&amp; pool = (inspectionLevel == 1) ? s_mainInspectorProcessPool : s_nestedInspectorProcessPool;
        if (!pool) {
            auto configuration = API::ProcessPoolConfiguration::createWithLegacyOptions();
            pool = &amp;WebProcessPool::create(configuration.get()).leakRef();
        }
        return *pool;
    }

This makes me think that if we can set a bit on the WebProcessProxy / WebProcess that says &quot;You&apos;re a Debugger Process&quot;.

Then when the first WebPage is created in the process pool it could propagate the property to the pressure handler:

    MemoryPressureHandler::singleton()-&gt;setDebuggerProcess();

This could then raise / affect the limit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1448879</commentid>
    <comment_count>2</comment_count>
    <who name="Blaze Burg">bburg</who>
    <bug_when>2018-08-08 16:22:01 -0700</bug_when>
    <thetext>Joe&apos;s investigation sounds like a good plan.

Is there any reasonable way to test this without screwing up bots? Obviously we can try to take a huge heap snapshot, but considering how slow bots are already compared to dev boxes, I&apos;m not sure a test like this would be stable or useful.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1448881</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2018-08-08 16:55:47 -0700</bug_when>
    <thetext>I&apos;m also skeptical of testing that uses huge amounts of memory.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1683482</commentid>
    <comment_count>4</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-08-27 14:13:40 -0700</bug_when>
    <thetext>&lt;rdar://problem/67896698&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>