MLightCAD
    Preparing search index...

    Function useMemoryProfile

    • Collects and holds the current drawing memory snapshot for the Memory palette.

      Returns {
          adoptPublishedSnapshot: () => boolean;
          collectedAtLabel: ComputedRef<string>;
          docTitle: Readonly<Ref<string, string>>;
          error: Ref<string | null, string | null>;
          fileName: Readonly<Ref<string, string>>;
          formatMemoryBytes: (bytes: number) => string;
          hydrateOrRefresh: () => Promise<void>;
          loading: Ref<boolean, boolean>;
          maxSummaryBytes: ComputedRef<number>;
          refresh: () => Promise<void>;
          snapshot: Ref<
              | {
                  collectedAt: number;
                  dataModel: {
                      categories: { count: number; estimatedBytes: number; name: string }[];
                      entitiesByType: { count: number; estimatedBytes: number; name: string }[];
                      entityCount: number;
                      estimate: {
                          byCategory: Record<string, AcDbMemoryEstimateBucket>;
                          byEntityType: Record<string, AcDbMemoryEstimateBucket>;
                          entityCount: number;
                          objectCount: number;
                          totalBytes: number;
                      };
                      estimatedBytes: number;
                      isEstimated: true;
                      objectCount: number;
                  };
                  fonts: {
                      estimatedBytes: number;
                      fonts: { estimatedBytes: number; name: string; type: string }[];
                      indexedDbBytes: number;
                      indexedDbFontCount: number;
                      isEstimated: true;
                      loadedFontCount: number;
                      mainThreadBytes: number;
                      missedCount: number;
                      missedNames: string[];
                      report?: {
                          collectedAt: number;
                          indexedDbFontCache: {
                              fontCount: number;
                              fonts: { bytes: number; name: string; type: string }[];
                              totalBytes: number;
                          };
                          jsHeap?: {
                              jsHeapSizeLimit: number;
                              totalJSHeapSize: number;
                              usedJSHeapSize: number;
                          };
                          mainThread: {
                              fonts: {
                                  charGeometryCache: {
                                      entries: ...;
                                      estimatedBytes: ...;
                                      maxEntries: ...;
                                  };
                                  estimatedBytes: number;
                                  meshGlyphs?: (...)
                                  | (...);
                                  names: (...)[];
                                  parsedFontEstimatedBytes: number;
                                  shxLayoutCache?: (...) | (...);
                                  sourceByteLength: number;
                                  type: (...) | (...);
                              }[];
                              id: string;
                              inFlightRequests?: number;
                              materials: {
                                  estimatedBytes: number;
                                  lineCount: number;
                                  meshCount: number;
                              };
                              totalEstimatedBytes: number;
                          };
                          totalEstimatedBytes: number;
                          workers: {
                              fonts: {
                                  charGeometryCache: ...;
                                  estimatedBytes: ...;
                                  meshGlyphs?: ...;
                                  names: ...;
                                  parsedFontEstimatedBytes: ...;
                                  shxLayoutCache?: ...;
                                  sourceByteLength: ...;
                                  type: ...;
                              }[];
                              id: string;
                              inFlightRequests?: number;
                              materials: {
                                  estimatedBytes: number;
                                  lineCount: number;
                                  meshCount: number;
                              };
                              totalEstimatedBytes: number;
                          }[];
                      };
                      workerBytes: number;
                  };
                  geometry: {
                      layers: {
                          entityCount: number;
                          geometryBytes: number;
                          layerName: string;
                          layoutIndex: number;
                          layoutKey: string;
                          lineBytes: number;
                          mappingBytes: number;
                          meshBytes: number;
                          pointBytes: number;
                          unbatchedBytes: number;
                          unbatchedCount: number;
                      }[];
                      scene: {
                          layouts: {
                              layers: {
                                  line: { indexed: ...; nonIndexed: ... };
                                  mesh: { indexed: ...; nonIndexed: ... };
                                  name: string;
                                  point: { indexed: ...; nonIndexed: ... };
                                  summary: {
                                      entityCount: ...;
                                      totalGeometrySize: ...;
                                      totalMappingSize: ...;
                                  };
                                  unbatched: { byType: ...; count: ...; geometrySize: ... };
                              }[];
                              summary: {
                                  entityCount: number;
                                  totalSize: {
                                      geometry: number;
                                      line: number;
                                      mapping: number;
                                      mesh: number;
                                      point: number;
                                      unbatched: number;
                                      unbatchedByType: { line: ...; mesh: ...; other: ...; point: ... };
                                      unbatchedCount: number;
                                  };
                              };
                          }[];
                          summary: {
                              entityCount: number;
                              layoutCount: number;
                              totalSize: {
                                  geometry: number;
                                  line: number;
                                  mapping: number;
                                  mesh: number;
                                  point: number;
                                  unbatched: number;
                                  unbatchedByType: {
                                      line: number;
                                      mesh: number;
                                      other: number;
                                      point: number;
                                  };
                                  unbatchedCount: number;
                              };
                          };
                      };
                  };
                  heap?: {
                      jsHeapSizeLimit: number;
                      totalJSHeapSize: number;
                      usedJSHeapSize: number;
                  };
                  materials: {
                      fill: { count: number; estimatedBytes: number };
                      line: { count: number; estimatedBytes: number };
                      point: { count: number; estimatedBytes: number };
                      totalCount: number;
                      totalEstimatedBytes: number;
                  };
                  spatial: {
                      layouts: {
                          layoutKey: string;
                          stats: {
                              childIndexCount?: number;
                              childItemCount?: number;
                              estimatedBytes: number;
                              itemCount: number;
                              kind: AcTrSpatialIndexKind;
                              linearChildCount?: number;
                              rbushChildCount?: number;
                              rootItemCount?: number;
                          };
                      }[];
                      totalChildItems: number;
                      totalEstimatedBytes: number;
                      totalRootItems: number;
                  };
                  summary: {
                      bytes: number;
                      detail?: string;
                      id: string;
                      isEstimated: boolean;
                  }[];
              }
              | null,
              | AcApMemorySnapshot
              | {
                  collectedAt: number;
                  dataModel: {
                      categories: { count: number; estimatedBytes: number; name: string }[];
                      entitiesByType: { count: number; estimatedBytes: number; name: string }[];
                      entityCount: number;
                      estimate: {
                          byCategory: Record<string, AcDbMemoryEstimateBucket>;
                          byEntityType: Record<string, AcDbMemoryEstimateBucket>;
                          entityCount: number;
                          objectCount: number;
                          totalBytes: number;
                      };
                      estimatedBytes: number;
                      isEstimated: true;
                      objectCount: number;
                  };
                  fonts: {
                      estimatedBytes: number;
                      fonts: { estimatedBytes: number; name: string; type: string }[];
                      indexedDbBytes: number;
                      indexedDbFontCount: number;
                      isEstimated: true;
                      loadedFontCount: number;
                      mainThreadBytes: number;
                      missedCount: number;
                      missedNames: string[];
                      report?: {
                          collectedAt: number;
                          indexedDbFontCache: {
                              fontCount: number;
                              fonts: { bytes: number; name: string; type: string }[];
                              totalBytes: number;
                          };
                          jsHeap?: {
                              jsHeapSizeLimit: number;
                              totalJSHeapSize: number;
                              usedJSHeapSize: number;
                          };
                          mainThread: {
                              fonts: {
                                  charGeometryCache: {
                                      entries: ...;
                                      estimatedBytes: ...;
                                      maxEntries: ...;
                                  };
                                  estimatedBytes: number;
                                  meshGlyphs?: (...)
                                  | (...);
                                  names: (...)[];
                                  parsedFontEstimatedBytes: number;
                                  shxLayoutCache?: (...) | (...);
                                  sourceByteLength: number;
                                  type: (...) | (...);
                              }[];
                              id: string;
                              inFlightRequests?: number;
                              materials: {
                                  estimatedBytes: number;
                                  lineCount: number;
                                  meshCount: number;
                              };
                              totalEstimatedBytes: number;
                          };
                          totalEstimatedBytes: number;
                          workers: {
                              fonts: {
                                  charGeometryCache: ...;
                                  estimatedBytes: ...;
                                  meshGlyphs?: ...;
                                  names: ...;
                                  parsedFontEstimatedBytes: ...;
                                  shxLayoutCache?: ...;
                                  sourceByteLength: ...;
                                  type: ...;
                              }[];
                              id: string;
                              inFlightRequests?: number;
                              materials: {
                                  estimatedBytes: number;
                                  lineCount: number;
                                  meshCount: number;
                              };
                              totalEstimatedBytes: number;
                          }[];
                      };
                      workerBytes: number;
                  };
                  geometry: {
                      layers: {
                          entityCount: number;
                          geometryBytes: number;
                          layerName: string;
                          layoutIndex: number;
                          layoutKey: string;
                          lineBytes: number;
                          mappingBytes: number;
                          meshBytes: number;
                          pointBytes: number;
                          unbatchedBytes: number;
                          unbatchedCount: number;
                      }[];
                      scene: {
                          layouts: {
                              layers: {
                                  line: { indexed: ...; nonIndexed: ... };
                                  mesh: { indexed: ...; nonIndexed: ... };
                                  name: string;
                                  point: { indexed: ...; nonIndexed: ... };
                                  summary: {
                                      entityCount: ...;
                                      totalGeometrySize: ...;
                                      totalMappingSize: ...;
                                  };
                                  unbatched: { byType: ...; count: ...; geometrySize: ... };
                              }[];
                              summary: {
                                  entityCount: number;
                                  totalSize: {
                                      geometry: number;
                                      line: number;
                                      mapping: number;
                                      mesh: number;
                                      point: number;
                                      unbatched: number;
                                      unbatchedByType: { line: ...; mesh: ...; other: ...; point: ... };
                                      unbatchedCount: number;
                                  };
                              };
                          }[];
                          summary: {
                              entityCount: number;
                              layoutCount: number;
                              totalSize: {
                                  geometry: number;
                                  line: number;
                                  mapping: number;
                                  mesh: number;
                                  point: number;
                                  unbatched: number;
                                  unbatchedByType: {
                                      line: number;
                                      mesh: number;
                                      other: number;
                                      point: number;
                                  };
                                  unbatchedCount: number;
                              };
                          };
                      };
                  };
                  heap?: {
                      jsHeapSizeLimit: number;
                      totalJSHeapSize: number;
                      usedJSHeapSize: number;
                  };
                  materials: {
                      fill: { count: number; estimatedBytes: number };
                      line: { count: number; estimatedBytes: number };
                      point: { count: number; estimatedBytes: number };
                      totalCount: number;
                      totalEstimatedBytes: number;
                  };
                  spatial: {
                      layouts: {
                          layoutKey: string;
                          stats: {
                              childIndexCount?: number;
                              childItemCount?: number;
                              estimatedBytes: number;
                              itemCount: number;
                              kind: AcTrSpatialIndexKind;
                              linearChildCount?: number;
                              rbushChildCount?: number;
                              rootItemCount?: number;
                          };
                      }[];
                      totalChildItems: number;
                      totalEstimatedBytes: number;
                      totalRootItems: number;
                  };
                  summary: {
                      bytes: number;
                      detail?: string;
                      id: string;
                      isEstimated: boolean;
                  }[];
              }
              | null,
          >;
          summaryRows: ComputedRef<
              { bytes: number; detail?: string; id: string; isEstimated: boolean }[],
          >;
      }

      • adoptPublishedSnapshot: () => boolean

        Adopts a command-published snapshot when one is pending.

      • collectedAtLabel: ComputedRef<string>
      • docTitle: Readonly<Ref<string, string>>
      • error: Ref<string | null, string | null>
      • fileName: Readonly<Ref<string, string>>
      • formatMemoryBytes: (bytes: number) => string
      • hydrateOrRefresh: () => Promise<void>

        Applies a command-published snapshot when present; otherwise collects one.

      • loading: Ref<boolean, boolean>
      • maxSummaryBytes: ComputedRef<number>
      • refresh: () => Promise<void>
      • snapshot: Ref<
            | {
                collectedAt: number;
                dataModel: {
                    categories: { count: number; estimatedBytes: number; name: string }[];
                    entitiesByType: { count: number; estimatedBytes: number; name: string }[];
                    entityCount: number;
                    estimate: {
                        byCategory: Record<string, AcDbMemoryEstimateBucket>;
                        byEntityType: Record<string, AcDbMemoryEstimateBucket>;
                        entityCount: number;
                        objectCount: number;
                        totalBytes: number;
                    };
                    estimatedBytes: number;
                    isEstimated: true;
                    objectCount: number;
                };
                fonts: {
                    estimatedBytes: number;
                    fonts: { estimatedBytes: number; name: string; type: string }[];
                    indexedDbBytes: number;
                    indexedDbFontCount: number;
                    isEstimated: true;
                    loadedFontCount: number;
                    mainThreadBytes: number;
                    missedCount: number;
                    missedNames: string[];
                    report?: {
                        collectedAt: number;
                        indexedDbFontCache: {
                            fontCount: number;
                            fonts: { bytes: number; name: string; type: string }[];
                            totalBytes: number;
                        };
                        jsHeap?: {
                            jsHeapSizeLimit: number;
                            totalJSHeapSize: number;
                            usedJSHeapSize: number;
                        };
                        mainThread: {
                            fonts: {
                                charGeometryCache: {
                                    entries: ...;
                                    estimatedBytes: ...;
                                    maxEntries: ...;
                                };
                                estimatedBytes: number;
                                meshGlyphs?: (...)
                                | (...);
                                names: (...)[];
                                parsedFontEstimatedBytes: number;
                                shxLayoutCache?: (...) | (...);
                                sourceByteLength: number;
                                type: (...) | (...);
                            }[];
                            id: string;
                            inFlightRequests?: number;
                            materials: {
                                estimatedBytes: number;
                                lineCount: number;
                                meshCount: number;
                            };
                            totalEstimatedBytes: number;
                        };
                        totalEstimatedBytes: number;
                        workers: {
                            fonts: {
                                charGeometryCache: ...;
                                estimatedBytes: ...;
                                meshGlyphs?: ...;
                                names: ...;
                                parsedFontEstimatedBytes: ...;
                                shxLayoutCache?: ...;
                                sourceByteLength: ...;
                                type: ...;
                            }[];
                            id: string;
                            inFlightRequests?: number;
                            materials: {
                                estimatedBytes: number;
                                lineCount: number;
                                meshCount: number;
                            };
                            totalEstimatedBytes: number;
                        }[];
                    };
                    workerBytes: number;
                };
                geometry: {
                    layers: {
                        entityCount: number;
                        geometryBytes: number;
                        layerName: string;
                        layoutIndex: number;
                        layoutKey: string;
                        lineBytes: number;
                        mappingBytes: number;
                        meshBytes: number;
                        pointBytes: number;
                        unbatchedBytes: number;
                        unbatchedCount: number;
                    }[];
                    scene: {
                        layouts: {
                            layers: {
                                line: { indexed: ...; nonIndexed: ... };
                                mesh: { indexed: ...; nonIndexed: ... };
                                name: string;
                                point: { indexed: ...; nonIndexed: ... };
                                summary: {
                                    entityCount: ...;
                                    totalGeometrySize: ...;
                                    totalMappingSize: ...;
                                };
                                unbatched: { byType: ...; count: ...; geometrySize: ... };
                            }[];
                            summary: {
                                entityCount: number;
                                totalSize: {
                                    geometry: number;
                                    line: number;
                                    mapping: number;
                                    mesh: number;
                                    point: number;
                                    unbatched: number;
                                    unbatchedByType: { line: ...; mesh: ...; other: ...; point: ... };
                                    unbatchedCount: number;
                                };
                            };
                        }[];
                        summary: {
                            entityCount: number;
                            layoutCount: number;
                            totalSize: {
                                geometry: number;
                                line: number;
                                mapping: number;
                                mesh: number;
                                point: number;
                                unbatched: number;
                                unbatchedByType: {
                                    line: number;
                                    mesh: number;
                                    other: number;
                                    point: number;
                                };
                                unbatchedCount: number;
                            };
                        };
                    };
                };
                heap?: {
                    jsHeapSizeLimit: number;
                    totalJSHeapSize: number;
                    usedJSHeapSize: number;
                };
                materials: {
                    fill: { count: number; estimatedBytes: number };
                    line: { count: number; estimatedBytes: number };
                    point: { count: number; estimatedBytes: number };
                    totalCount: number;
                    totalEstimatedBytes: number;
                };
                spatial: {
                    layouts: {
                        layoutKey: string;
                        stats: {
                            childIndexCount?: number;
                            childItemCount?: number;
                            estimatedBytes: number;
                            itemCount: number;
                            kind: AcTrSpatialIndexKind;
                            linearChildCount?: number;
                            rbushChildCount?: number;
                            rootItemCount?: number;
                        };
                    }[];
                    totalChildItems: number;
                    totalEstimatedBytes: number;
                    totalRootItems: number;
                };
                summary: {
                    bytes: number;
                    detail?: string;
                    id: string;
                    isEstimated: boolean;
                }[];
            }
            | null,
            | AcApMemorySnapshot
            | {
                collectedAt: number;
                dataModel: {
                    categories: { count: number; estimatedBytes: number; name: string }[];
                    entitiesByType: { count: number; estimatedBytes: number; name: string }[];
                    entityCount: number;
                    estimate: {
                        byCategory: Record<string, AcDbMemoryEstimateBucket>;
                        byEntityType: Record<string, AcDbMemoryEstimateBucket>;
                        entityCount: number;
                        objectCount: number;
                        totalBytes: number;
                    };
                    estimatedBytes: number;
                    isEstimated: true;
                    objectCount: number;
                };
                fonts: {
                    estimatedBytes: number;
                    fonts: { estimatedBytes: number; name: string; type: string }[];
                    indexedDbBytes: number;
                    indexedDbFontCount: number;
                    isEstimated: true;
                    loadedFontCount: number;
                    mainThreadBytes: number;
                    missedCount: number;
                    missedNames: string[];
                    report?: {
                        collectedAt: number;
                        indexedDbFontCache: {
                            fontCount: number;
                            fonts: { bytes: number; name: string; type: string }[];
                            totalBytes: number;
                        };
                        jsHeap?: {
                            jsHeapSizeLimit: number;
                            totalJSHeapSize: number;
                            usedJSHeapSize: number;
                        };
                        mainThread: {
                            fonts: {
                                charGeometryCache: {
                                    entries: ...;
                                    estimatedBytes: ...;
                                    maxEntries: ...;
                                };
                                estimatedBytes: number;
                                meshGlyphs?: (...)
                                | (...);
                                names: (...)[];
                                parsedFontEstimatedBytes: number;
                                shxLayoutCache?: (...) | (...);
                                sourceByteLength: number;
                                type: (...) | (...);
                            }[];
                            id: string;
                            inFlightRequests?: number;
                            materials: {
                                estimatedBytes: number;
                                lineCount: number;
                                meshCount: number;
                            };
                            totalEstimatedBytes: number;
                        };
                        totalEstimatedBytes: number;
                        workers: {
                            fonts: {
                                charGeometryCache: ...;
                                estimatedBytes: ...;
                                meshGlyphs?: ...;
                                names: ...;
                                parsedFontEstimatedBytes: ...;
                                shxLayoutCache?: ...;
                                sourceByteLength: ...;
                                type: ...;
                            }[];
                            id: string;
                            inFlightRequests?: number;
                            materials: {
                                estimatedBytes: number;
                                lineCount: number;
                                meshCount: number;
                            };
                            totalEstimatedBytes: number;
                        }[];
                    };
                    workerBytes: number;
                };
                geometry: {
                    layers: {
                        entityCount: number;
                        geometryBytes: number;
                        layerName: string;
                        layoutIndex: number;
                        layoutKey: string;
                        lineBytes: number;
                        mappingBytes: number;
                        meshBytes: number;
                        pointBytes: number;
                        unbatchedBytes: number;
                        unbatchedCount: number;
                    }[];
                    scene: {
                        layouts: {
                            layers: {
                                line: { indexed: ...; nonIndexed: ... };
                                mesh: { indexed: ...; nonIndexed: ... };
                                name: string;
                                point: { indexed: ...; nonIndexed: ... };
                                summary: {
                                    entityCount: ...;
                                    totalGeometrySize: ...;
                                    totalMappingSize: ...;
                                };
                                unbatched: { byType: ...; count: ...; geometrySize: ... };
                            }[];
                            summary: {
                                entityCount: number;
                                totalSize: {
                                    geometry: number;
                                    line: number;
                                    mapping: number;
                                    mesh: number;
                                    point: number;
                                    unbatched: number;
                                    unbatchedByType: { line: ...; mesh: ...; other: ...; point: ... };
                                    unbatchedCount: number;
                                };
                            };
                        }[];
                        summary: {
                            entityCount: number;
                            layoutCount: number;
                            totalSize: {
                                geometry: number;
                                line: number;
                                mapping: number;
                                mesh: number;
                                point: number;
                                unbatched: number;
                                unbatchedByType: {
                                    line: number;
                                    mesh: number;
                                    other: number;
                                    point: number;
                                };
                                unbatchedCount: number;
                            };
                        };
                    };
                };
                heap?: {
                    jsHeapSizeLimit: number;
                    totalJSHeapSize: number;
                    usedJSHeapSize: number;
                };
                materials: {
                    fill: { count: number; estimatedBytes: number };
                    line: { count: number; estimatedBytes: number };
                    point: { count: number; estimatedBytes: number };
                    totalCount: number;
                    totalEstimatedBytes: number;
                };
                spatial: {
                    layouts: {
                        layoutKey: string;
                        stats: {
                            childIndexCount?: number;
                            childItemCount?: number;
                            estimatedBytes: number;
                            itemCount: number;
                            kind: AcTrSpatialIndexKind;
                            linearChildCount?: number;
                            rbushChildCount?: number;
                            rootItemCount?: number;
                        };
                    }[];
                    totalChildItems: number;
                    totalEstimatedBytes: number;
                    totalRootItems: number;
                };
                summary: {
                    bytes: number;
                    detail?: string;
                    id: string;
                    isEstimated: boolean;
                }[];
            }
            | null,
        >
      • summaryRows: ComputedRef<
            { bytes: number; detail?: string; id: string; isEstimated: boolean }[],
        >