Skip to main content
All docs
V24.1

Document Management in the Spreadsheet

The Spreadsheet control always contains a document. When you open a document, the control loads it to storage in the web server’s memory (RAM). This storage is a static dictionary inaccessible to developers.

The Spreadsheet uses unique strings to identify documents in the storage. The way a document gets its identifier depends on the document source:

  • When you open a document from a file system, the control uses the physical path to this document as the identifier.
  • When you open a document from a byte array or stream, you pass an identifier as a method parameter.
  • A new document has an empty identifier. Generate a unique string identifier for the new document to be able to save pending changes.

The document remains in server memory until one of the following events:

  • Your code closes the document.
  • The server is restarted. Until this event, the document takes up memory even if this document is not being used for a long time.
  • The DocumentManager hibernates the document. Enable document hibernation to reduce server memory consumption and prevent the loss of unsaved changes when the server is restarted.