Reputation: 1
I have apryse webviewer (client-side only), and had it setup as recommended in the docs wherein we're using only 1 instance of webviewer, and calling loadDocument
to change files to be previewed.
When loading an excel document (around 2-3mb) in Edge, memory increase up to 3gb when checked via browser's task manager.
When closing the modal, we tried calling dispose
and closeDocument
, however, the memory is not released and task manager still displays 3gb.
The task manager displays PDFWorker and OfficeWorker under the tab, and in the memory tool, it shows that the workers have large ArrayBufferJs values.
At first, issue also occurs in Chrome, but after changing the backend type to asm
, it was resolved.
However, problem still exists for Edge.
Is there a way to release the memory used in the pdf/office worker?
Problem is when the user opens another file, memory increases again and the browser ends up crashing.
*The excel file contains sheets that have infinite column headers (click row header and change fill color)
Setup is as follows:
let webviewerInstance = null;
// on mounted, instantiate webviewer
WebViewer(
{
path: '../../../lib',
licenseKey: LICENSE_KEY,
backendType: "asm",
},
document.getElementById('viewer')
).then(instance => {
// store instance for later use
this.webviewerInstance = instance;
});
// on click button, fetch data and open modal containing webviewer UI
/** fetch goes here **/
...
let fileUint8Array = new Uint8Array(buffer);
let file = new Blob([fileUint8Array], { type: "application/octet-stream" });
this.webviewerInstance.UI.loadDocument(file, { filename: "sample", extension: "xlsx" });
fileUint8Array = null;
file = null;
// on click close modal containing webviewer UI
this.webViewerInstance.UI.dispose();
this.webViewerInstance.UI.closeDocument();
We tried the following but to no avail:
dispose
closeDocument
asm
ems
wasm
resetWorker(worker)
with new worker in hopes that previous worker will resetUpdate
Excel file having infinite number of columns seem to cause the spike in memory.
Tried a similar 2-3mb excel file without infinite columns and it just rendered fine.
Upvotes: 0
Views: 207
Reputation: 1
We suggest not loading Excel files with infinite trailing cells as this could be causing the memory issue.
Upvotes: 0