<!doctype html>

<html>
  <head>
    <link rel="stylesheet" href="lib/style.css">
    <script src="lib/script.js"></script>
  </head>

  <body>
    <script src="/lib/script.js"></script>
    <button onclick="measureMemory()">Measure Memory</button>
  </body>
</html>
function measureMemory() {
    const arraySize = 25 * Math.pow(1000, 2);
    console.log(`${performance.memory.usedJSHeapSize / Math.pow(1000, 2)} MB`);
    const array1 = new Array(arraySize).fill(1.1);
    console.log(`${performance.memory.usedJSHeapSize / Math.pow(1000, 2)} MB`);
    const array2 = new Array(arraySize).fill(1);
    console.log(`${performance.memory.usedJSHeapSize / Math.pow(1000, 2)} MB`);
}