Reputation: 21
I am currently encountering a persistent cache memory growth issue within our Forge Viewer implementation and need assistance in resolving this matter. The problem at hand is that the cache memory utilization keeps expanding while using the application, sometimes reaching a size exceeding 1 GB.
To ascertain whether this challenge originates from our custom application's viewer or if it's inherent to the Forge Viewer itself, I conducted a series of tests using the Forge-provided viewer accessible at https://autodesk-forge.github.io/forge-tutorial-postman/display_svf2.html.
Findings:
Initial Model Load: When the model is initially loaded, it consumes approximately 250 MB of memory.
Model Reload: Upon reloading the same model, memory usage escalates by about 20-30% (approximately 50 MB), leading to a cumulative memory consumption of around 300 MB (250 MB + 50 MB).
Reopening the Same Model: Subsequent reopenings of the same model trigger an approximate 5% cache size expansion, resulting in a memory usage of 310-320 MB.
Memory Stabilization: Beyond this point, memory usage appears to stabilize, with minimal deviation beyond the established cache size.
However, complications emerge when diverse models are loaded. Each new model introduces its cache size requirement, which hinges on the dimensions of the model. For instance, if the second model occupies 300 MB, the collective cache memory balloons to 610 MB (310 MB + 300 MB).
Consequently, with each introduction of a novel model, storage requirements swell, leading to a consistent, incremental growth in the overall cache size.
I have observed this behavior both within our proprietary viewer implementation and within the Forge Viewer itself, confirming that the issue is not isolated to our application You can see the size in given image: .enter image description here
I am seeking advice and potential solutions to mitigate this cache memory growth issue. How can I address this problem and ensure that cache memory utilization remains within reasonable limits? Are there any best practices or configurations that can help manage and optimize the cache memory in Forge Viewer?
Any insights, suggestions, or experiences shared would be greatly appreciated. Thank you in advance for your assistance!
Upvotes: 2
Views: 168
Reputation: 9942
This is by design. The viewer caches loaded geometry data to improve subsequent loading of designs. For the SVF2 file format, the geometry data is cached in IndexedDB (which offers more space than other storage alternatives):
Currently there's no way to limit the size of the IndexedDB database. You can add disableIndexedDb=true
query parameter to the URL to disable IndexedDB caching entirely.
Upvotes: 1