Documentation
    Preparing search index...

    Function recordResourceMemory

    • Writes §83's live-resource totals into the §84 record (A-5, 2026-08-07).

      recordResourceMemory(
      app.stats,
      textureMemoryBytes(), // @fourjs/render
      geometryMemoryBytes(), // @fourjs/geometry
      );

      Two numbers rather than a transcribed record, for the reason the module header gives: the producers hold accumulators, not objects, so there is no foreign shape to agree with and nothing to allocate.

      Call it after the frame's work, like recordRenderStatistics: the two counters are levels, so the answer that means anything is the one taken once the frame's creations and disposals have happened. Passing the same numbers twice overwrites rather than accumulates, which is what makes a total that fell report as fallen.

      The totals are process-wide rather than per-application, because a resource belongs to whoever created it and not to an Application (§83) — two applications sharing an atlas are each honestly told about the whole of it. They are also an accounting of what the engine holds, not a query of the driver: a geometry created and never drawn has no GPU buffer yet. The producing modules (resource-memory.ts, in both packages) state both properties at length.

      Parameters

      • stats: FrameStats
      • textureBytes: number
      • bufferBytes: number

      Returns void