<?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>46252</bug_id>
          
          <creation_ts>2010-09-22 02:16:01 -0700</creation_ts>
          <short_desc>[Qt] [WebKit2] Shared memory design should be improved</short_desc>
          <delta_ts>2011-01-25 10:03:34 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit2</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>51984</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Balazs Kelemen">kbalazs</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abecsi</cc>
    
    <cc>kenneth</cc>
    
    <cc>koivisto</cc>
    
    <cc>laszlo.gombos</cc>
    
    <cc>s.mathur</cc>
    
    <cc>zherczeg</cc>
    
    <cc>zoltan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>282856</commentid>
    <comment_count>0</comment_count>
    <who name="Balazs Kelemen">kbalazs</who>
    <bug_when>2010-09-22 02:16:01 -0700</bug_when>
    <thetext>In 4594 a heated debate had been started about the shared memory implementation.
We should reconsider how to allocate the shared memory and how to release it on exit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>282861</commentid>
    <comment_count>1</comment_count>
    <who name="Balazs Kelemen">kbalazs</who>
    <bug_when>2010-09-22 02:24:24 -0700</bug_when>
    <thetext>We already have a platform independent shared memory implementation: QSharedMemory. I do not understand why we do not use that. I remember that Kenneth told me that it has some problems with releasing the allocated area.
Please explain the arguments against QSharedMemory in more details.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>283020</commentid>
    <comment_count>2</comment_count>
    <who name="Kenneth Rohde Christiansen">kenneth</who>
    <bug_when>2010-09-22 10:14:56 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; We already have a platform independent shared memory implementation: QSharedMemory. I do not understand why we do not use that. I remember that Kenneth told me that it has some problems with releasing the allocated area.
&gt; Please explain the arguments against QSharedMemory in more details.

1) It is limited to 2MB on mac and it is not something normal users are going to change
2) If an app crashes the shared memory is not freed, so we will have even less memory

What do you have against I/O mapped memory? The memory is never being written to disk/flushed and we do not have any limit.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>283065</commentid>
    <comment_count>3</comment_count>
    <who name="Balazs Kelemen">kbalazs</who>
    <bug_when>2010-09-22 11:10:09 -0700</bug_when>
    <thetext>&gt; 1) It is limited to 2MB on mac and it is not something normal users are going to change

I think this should be fixed in QSharedMemory with the trick we are using.

&gt; 2) If an app crashes the shared memory is not freed, so we will have even less memory

Really? If all of the processes died or terminated that using the shared memory then the OS reclaims it, isn&apos;t it?

&gt; 
&gt; What do you have against I/O mapped memory? The memory is never being written to disk/flushed and we do not have any limit.

I find the files somewhat useless since on linux or windows you can allocate virtual address space without underlying files. If you cannot do it on mac then I am fine with the I/O mapped memory. (A comment should be added about that.) Anyway, we should fix the problems you mentioned in 4594.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>285454</commentid>
    <comment_count>4</comment_count>
    <who name="Andras Becsi">abecsi</who>
    <bug_when>2010-09-27 07:44:37 -0700</bug_when>
    <thetext>(In reply to comment #0)
&gt; In 4594 a heated debate had been started about the shared memory implementation.
The discussion started in https://bugs.webkit.org/show_bug.cgi?id=45984.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>310837</commentid>
    <comment_count>5</comment_count>
    <who name="Siddharth Mathur">s.mathur</who>
    <bug_when>2010-11-18 06:46:32 -0800</bug_when>
    <thetext>BTW, on Symbian OS there is no native concept of a file-mapped virtual memory AFAIK, so the only correct way to do shared memory in a scalable and performant way is to either: 
a) Use QSharedMemory (which uses Symbian OS RChunk, the entry point into kernel&apos;s memory management features) 
b) Use RChunk API directly in case QSharedMemory&apos;s RChunk usage is too simplistic or inefficient for Webkit&apos;2 demanding needs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>311361</commentid>
    <comment_count>6</comment_count>
    <who name="Balazs Kelemen">kbalazs</who>
    <bug_when>2010-11-19 04:48:07 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; BTW, on Symbian OS there is no native concept of a file-mapped virtual memory AFAIK, so the only correct way to do shared memory in a scalable and performant way is to either: 
&gt; a) Use QSharedMemory (which uses Symbian OS RChunk, the entry point into kernel&apos;s memory management features) 
&gt; b) Use RChunk API directly in case QSharedMemory&apos;s RChunk usage is too simplistic or inefficient for Webkit&apos;2 demanding needs.

I vote for QSharedMemory. We are also using it in the SharedMemory class.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>339710</commentid>
    <comment_count>7</comment_count>
    <who name="Balazs Kelemen">kbalazs</who>
    <bug_when>2011-01-25 10:03:34 -0800</bug_when>
    <thetext>This job has been done by http://trac.webkit.org/changeset/76507

*** This bug has been marked as a duplicate of bug 51984 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>