Sun Java System Web Server 7.0 Update 2 Developer's Guide to Java Web Applications

MMap Session Manager (UNIX Only)

MMap is a persistent memory map (mmap), file-based session manager that works in both single-process and multi-process mode.

Note –

The MaxProcs directive in the magnus.conf file determines whether the server is running in single-process or multi-process mode. The Maxprocs is deprecated in Web Server 7.0.

Enabling MMap

You can enable MMap to change its default parameters. You can also enable MMap for a particular context if the server is running in single-process mode. To do so, edit the sun-web.xml file for the web application as in the following example. Note that persistence-type must be set to mmap.

            <session-manager persistence-type=”mmap”>

For more information about the sun-web.xml file, see Chapter 9, Deploying Web Applications.

Manager Properties for MMap

The following table describes manager-properties properties for the MMap session manager.

Table 6–7 manager-properties Properties for MMap

Property Name  

Default Value  




The maximum number of sessions maintained by the session manager at any given time. The session manager refuses to create any more new sessions if maxSessions number of sessions are already present at that time.



The maximum number of values or objects a session can hold. 



The maximum size of each value or object that can be stored in the session. 



The amount of time in seconds after a session is last accessed by the client before the session manager destroys it. Those sessions that haven’t been accessed for at least timeOut seconds are destroyed by the reaper method.



The amount of time in seconds that the SessionReaper thread sleeps before calling the reaper method again.



The number of cross-process locks to use for synchronizing access to individual sessions across processes. The default value is used if the value 0 is specified. This parameter is ignored in single-process mode.

Note –

MMap can only store objects that implement