<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - JavaScriptCore Garbage Collector Issue"
   href="https://bugs.webkit.org/show_bug.cgi?id=145433">145433</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>JavaScriptCore Garbage Collector Issue
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>420+
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>iOS
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>iOS 8.2
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Major
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>JavaScriptCore
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>maxh&#64;fs.cs.hm.edu
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hello,

Geoffrey Garen advised me to report my following problem here, as it seems to be a bug in JavaScriptCore.

I implemented a JavaScript library for a Swift iOS app connecting via JavaScriptCore. Although I don’t really know if this mail list is the correct place to ask, I thought I’d give it a shot.
I really liked how easy it was to get Swift to work with JavaScript and vice versa. But I stumbled upon a problem when I was testing the performance of my app. I wrote a XCTest in Xcode which performs multiple calls of the JavaScript library (with loops) but it always stops or freezes after the 292nd call.
I guess that the JavaScriptCore context (or virtual machine) is not deinitialized after the method call was successful. I even tried a manual deinitialize (or is deallocate the better word?) but it still freezes. I looked up the allocations and threads in Instruments and it shows multiple VM: JS garbage collector allocations which are still active in the app.
I wrote a question on StackOverflow with some code examples and the Instruments log:
<a href="http://stackoverflow.com/questions/30443993/javascriptcore-on-ios-vm-garbage-collector-not-automatically-emtpying">http://stackoverflow.com/questions/30443993/javascriptcore-on-ios-vm-garbage-collector-not-automatically-emtpying</a>
but I haven’t received a single answer yet. I guess JavaScriptCore on iOS is still something that is not being used very much.
I was able to reproduce the issue in another project which I added as a zip file to this report. Just open the project and test or profile it. The loop in the test class will freeze the app after the 292nd call.

I would be very happy if someone could take a look into my problem and share thoughts on it. This is part of my bachelor thesis so it would really help a lot.

Thank you very much in advance and best regards,
Max Hentschel

p.s.: I am using iOS 8.3 but it wasn't selectable from the dropdown. And I cannot tell the version of JavaScriptCore as I wasn't able to find out which version iOS 8.3 uses (no note on Apple's Developer page as well).</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>