The documentation is missing one small piece of information unfortunately. When using the Autodesk.Viewing.MemoryLimited extension you have to configure the actual memory limit you want to impose, for example, like so:
const config = {
loaderExtensions: { svf: 'Autodesk.MemoryLimited' },
memory: {
limit: 1024
}
};
const viewer = new Autodesk.Viewing.GuiViewer3D(document.getElementById('preview'), config);
Also, note that the memory-limited loading will only be enabled when your model is larger than the configured threshold. If you want to force the memory-limited loading even for smaller models, try this:
const config = {
loaderExtensions: { svf: 'Autodesk.MemoryLimited' },
memory: {
limit: 1024,
debug: {
force: true
}
}
};
const viewer = new Autodesk.Viewing.GuiViewer3D(document.getElementById('preview'), config);
Edit
The memory.debug object can contain additional properties customizing the behavior of the memory-limited loading. Those are meant for internal use but you could experiment with them as well:
options.debug = {
// Increase the max page out size. On slow (mobile) devices the scene
// traversal is a bottle neck and making this larger helps load more
// pack files earlier in the load.
maxPageOutSize: 195, // Max we will page out in one go
pixelCullingEnable: this.options.onDemandLoading, // Useful with on demand loading
pixelCullingThreshold: avp.PIXEL_CULLING_THRESHOLD,
occlusionThreshold: 1,
occlusionTestThreshold: 1,
startOcclusionTestingPackCount: 8,
testPackfileCount: 4,
useOcclusionInstancing: true,
automaticRefresh: true,
boxProxyMaxCount: 0, // show this many boxes during a render
boxProxyMinScreen: 0.4 // if entire render batch is >= 1/10 of the screen in area
};