I am debugging OpenSpeedTest an Ajax based network performance estimation tool. Which is maxing Multiple XHR requests to the server to benchmark user connection speed. I noticed HUGE memory Leake in Safari and i saw growing memory up to 100+Gb in Safari Networking Process after some time the repeated XHR requested retuned an error and stopped. I also noticed if we give 100Ms time before making new request Networking Process Growing Memory get resolved. Another most important issue i found is Performance difference in Normal Windows vs Private window without installing any Extensions the difference is huge. In Private window the Networking Process Growing Memory issue is not there. I tested this on Intel Mac and M1 Mac. Latest Stable and technology preview Safari. Why Networking Process Growing Memory if we make a new request every-time? Why Huge Performance difference in Private mode vs Normal windows?
Created attachment 430176 [details] Screenshot at 121 seconds of running the script Screenshot at 121 seconds of running the script
Created attachment 430177 [details] 100Gb Memory usage ss after 277 seconds 100Gb Memory usage screen after 277 seconds
Created attachment 430178 [details] Requests error after 350 seconds Network process exited after 110+Gb of memory usage Requests error after 350 seconds Network process exited after 110+Gb of memory usage
Created attachment 430180 [details] Safari Private Window vs Normal Window Performance Difference. Safari Private Window vs Normal Window Performance Difference. In this video i am showing private windows on the right and normal windows on the left. The first running number is the speed in Mbps that is 4000Mbps. As you can see from the video Private windows is Always 20% Faster than Normal Windows. Consistently getting 1000Mbps more on the private window. Why is that? I have not installed any extensions.
Maybe HTTP disk cache-related if it doesn't happen in private browsing?
I am having trouble reproducing on openspeedtest.com. I see some memory growth but not in the GBs.
Steps to reproduce the problem: 1.Install OpenSpeedTest Docker 2.Make sure you have 10GbE Networking 3.Run the test to see the Massive Memory Growth. You can change the download and upload test run time inside the docker image index.html file. currently it's 12 seconds. if you are using a 10GbE network you can quickly see the growth. I have written a script that run continuously and crash itself after 350 seconds. i can share it here if you like to test. thanks
<rdar://problem/78936212>
Sharing that script here would be quite helpful.
Created attachment 432656 [details] Fetch and XHR implementation, Run it on M1 MacMini 10GbE or any Client and Server with 10GbE Fetch and XHR implementation, Run it on M1 MacMini 10GbE or any Client and Server with 10GbE. Up to 1 Gbps you many not see Memory issues and perf. diff. between Normal window and Private window. So use 10GbE networking on both client and server.
Make sure, you disable Gzip from Server Side.
xhr.setRequestHeader("Cache-Control", "no-cache, no-store, max-age=0"); Resolved this memory leak. And Now Everything working fine.
Updated docker image with Server side cache header https://hub.docker.com/r/openspeedtest/latest How can i close this bug report? In my test safari is the fastest browser. Thank you!