Document Hibernation

  • 2 minutes to read


At the server DocumentManager object level, DevExpress office controls can automatically free server operative memory (RAM) by hibernating inactive open documents. Document hibernation is disabled by default.

If you enable document hibernation, open documents that remain idle for a certain period are released from server memory and saved to the server file system at a specific path. This reduces server memory consumption and prevents the loss of unsaved document changes even if planed IIS process recycling occurs.


The following hibernation settings are available through the API exposed by the DocumentManager object.

Property Name



Switches the hibernation functionality on or off. The default value is false.


Specifies the path to the server directory where open documents hibernate after the idle timeout period expires.


Specifies the idle timeout period before an open document is hibernated. The default value is TimeSpan.FromHours(1).

If an end user interacts with a hibernated document, the document is restored from the file to the server's RAM. Note that the Spreadsheet control looses the Undo/Redo history after hibernation.


Defines the timeout value that specifies how long hibernated documents are stored on the server before disposal. The default value is TimeSpan.FromHours(24).

After this timeout period has passed, a document file stored in HibernationStoragePath is deleted, and all unsaved end-user document changes are lost.


Specifies whether or not all open documents should be hibernated.

You should specify hibernation in the Application_Start handler in Global.asax. In this instance, even after a server fails, you are not required to reload the page with the RichEdit or Spreadsheet control - end users can continue to work with the open spreadsheet document. Each subsequent request will raise the Application_Start handler and define hibernation settings.


The following code example demonstrates how hibernation settings can be defined in the Application_Start method. Some of the settings are optional.

<%@ Application Language="C#" %>
<%@ Import Namespace="DevExpress.Web.Office" %>
<script runat="server">
    void Application_Start(object sender, EventArgs e) {
        // Code that runs on application startup
        DocumentManager.HibernationStoragePath = Server.MapPath("~/App_Data/HibernationStorage/"); //Required setting
        DocumentManager.HibernateTimeout = TimeSpan.FromMinutes(30); //Optional setting
        DocumentManager.HibernatedDocumentsDisposeTimeout = TimeSpan.FromDays(1); //Optional setting
        DocumentManager.HibernateAllDocumentsOnApplicationEnd = true; //Optional setting
        DocumentManager.EnableHibernation = true; //Required setting to turn the hibernation on
See Also