HP Service Manager Shared Memory Guide
HP Service Manager Shared Memory Guide
This document explains how Service Manager uses shared memory as well as how each area must be included
in the sizing calculation.
3
Shared Memory Sizing
Because the storage area of shared memory is not directly related to the number of users in the system, the per-
user shared memory requirement can only be estimated. A user requires 512 bytes of storage for their user
block, plus small amounts of storage for various overhead tasks. The user’s total shared memory depends on
the number of modules used, and the number of forms, dbdict records, links, format controls, and code records
they access. The estimated amount of shared memory per user will be higher for a smaller user base, because
the cached information in the system is usually relatively static and does not depend on the number of users in
the system.
A sample calculation for shared memory is:
48 MB + 1MB per 10 users + Shared Memory for IR (see below).
Important: Shared memory in a horizontally scaled environment must be calculated per machine based on
how many users this machine handles during peak times.
If the Service Manager Information Retrieval (IR) process is used, the IR Cache section of shared memory should
accommodate the size of all IR files that are used.
The default size allocated for IR is 30% of the total shared memory. If this amount does not match the
recommended size of shared memory for IR, use the ir_max_shared:<s ize_in _b y t es > parameter to set
aside additional shared memory for the IR process.
Cache Sizing
Cache is stored in slots. By default Service Manager uses 2003 cache slots. The cache report (sm -reportcache)
shows the cache slots used and average and maximum depths.
C:\scs\sm7\server\RUN>sm -reportcache
---------------------- Cache Statistics ----------------------
The average slot depth should be below 3 and the maximum should be below 10. If the average slot depth is
too deep, increase the cache_slots parameter to a larger prime number, such as 11001. Prime numbers are
most efficient for cache_slots. This is due to the fact that we calculate a hash for each item in the cache
resulting in numbers between 0 and 2 32 -1 (32-bit integer). These hash numbers have to be distributed – if
possible evenly – between the available cache slots. This is done with a modulus function against the
cache_slots. Using a prime number has a higher probability of distributing the cache items evenly amongst the
cache slots.
4
Unused items are removed from cache by the sync process. During the cache_clean_interval, the sync process
enters a timestamp into all cache items that have a use count of 0. During the next cache_clean_interval, if it
still shows the timestamp the item will be removed from cache. If the cache item was used after the first interval,
the use count overwrites the timestamp indicating the item has been recently used. Thus cache items that were
unused for cache_clean_interval (seconds) * 2 will be removed from the cache.
Current Size is the amount of shared memory allocated in bytes as defined by the shared_memory parameter
in the sm.ini file.
Free Space is the amount of shared memory that is available for use by processes. Free Space is gained
when previously used Shared Memory areas are made available again. Also, Free Space is the sum of
"Unused Space" (memory never before allocated) and "Freed Space" (memory in the free list chain that was
previously allocated) Free Space is shown as total bytes and as an overall percentage.
Unused Space represents available shared memory that has not yet been allocated. When Service Manager
starts, the entire amount of memory defined by the shared_memory parameter is allocated, and blocks may
5
then be allocated from within that shared memory as needed. Unused Space is shown in total bytes and as an
overall percentage.
Using sm -reportshm:1 to generate the Service Manager Shared Memory Report will produce a more detailed
listing of shared memory allocation.
Messages
Every message that is sent from one user to another is put into the message block section of shared memory.
The amount of shared memory allocated per message depends on the size of the message.
Resource Locks
Resource locks are created whenever the lock application is executed from RAD. For example when a user
edits an incident ticket, a resource lock is created for that ticket. If the ‘show locks’ option from the system
status is selected and you have a vertically-scaled environment, the information on existing locks is taken from
shared memory for all versions of Service Manager. However, in horizontally-scaled environments, the
information is taken from JVM private memory of each node for versions of Service Manager earlier SM 9.31,
or from the database for SM 9.31 and later versions.
Database Services
Tuning statistics regarding executed queries and database access are stored in this area. Statistics indicating
possible performance issues are written to the sc.alert.log.
6
Cache Overhead
Contains operators and other system information; It also contains overhead or miscellaneous items that need to
be stored for multi-process access
Application Cache
This area in shared memory holds code records, pre-parsed and split up by panel.
DBDict Cache
This area contains cached Table Definitions (dbdict records) as well as other cached data records such as:
format, link, format control, category, scmessage.
JOIN/ERD/TYPE Cache
This area contains records from joindef, erddef, scaccess, scmandant and sctypecheck
JavaScript Members
This area contains information used by or required for JavaScript applications. It does not contain JavaScript
code, but rather information on the current version of the Script member.
IR Expert Cache
This area in shared memory holds the term and document lists used by Service Manager’s IR expert process.
7
Horizontal Scaling: Special Considerations
Each horizontally scaled host machine has its own shared memory calculated based on the amount of users
supposed to be running on that machine. The IR expert section has to be added to all machines in the group,
which makes the calculation for each machine:
48 MB + 1 MB per 10 users + IR Size
In the horizontally scaled system messages to users as well as Cache updates on changed cached records are
communicated to all shared memory sections of all host machines in the group.
Locks are not held in shared memory at all in horizontally scaled systems. Locks are handled differently
depending on your version of Service Manager. For versions of Service Manager earlier than Service
Manager 9.31, locks are communicated by using UDP Multicasting between the systems and the locking
information is held in the JVM. For Service Manager 9.31 and later versions, locks are stored in the central
RDBMS. For more information on how locks are managed in Service Manager 9.31, see the Lock
Management topic in the Service Manager Help Server.
Troubleshooting
As soon as less than 25 % of shared memory is unused, it is recommended that the amount of shared memory
be increased by modifying the shared_memory parameter in the sm.ini file. Unused shared memory is the
amount of memory that has never been allocated. The real percentage of available memory is always higher
than what the unused percentage in the Service Manager Shared Memory Report depicts.
Because shared memory can become fragmented, leaving at least 25% of free space is recommended. This
will ensure that fragmentation does not prevent new space from being allocated within the shared memory
area.
The s h a r ed _m em or y _a dd r es s :<m em or y a d d r es s > parameter can be used on all operating systems to
ensure that shared memory allocation is kept in an area that will not interfere with shared libraries, stacks,
heaps or other memory related data structures. You can use this parameter to specify a new address that has
enough contiguous memory for the HP Service Manager process.
If you encounter a shared memory allocation failure, the address that the HP Service Manager process is using
does not have enough contiguous memory. On Windows, the sm.log file lists recommendations for possible
shared_memory_address parameter values. If the debugvmmap parameter is active, the log also contains
a map of virtual memory at the time of the failure.
For more details, see the following Service Manager online help topics:
• Startup parameter: shared_memory_address
• Troubleshooting: Failed to initialize or attach to shared memory environment (Windows only)
Note: The defaults should be working for all platforms. You should only use this parameter when instructed to
do so by HP Customer Support.
This Web site provides contact information and details about the products, services, and support that HP
Software offers.
HP Software online software support provides customer self-solve capabilities. It provides a fast and efficient
way to access interactive technical support tools needed to manage your business. As a valued customer, you
can benefit by being able to:
• Search for knowledge documents of interest
• Submit and track progress on support cases
• Submit enhancement requests online
• Download software patches
• Manage a support contract
• Look up HP support contacts
• Review information about available services
• Enter discussions with other software customers
• Research and register for software training
Note: Most of the support areas require that you register as an HP Passport user and sign in. Many also
require an active support contract.
To find more information about support access levels, go to the following URL:
www.hp.com/go/hpsoftwaresupport/new_access_levels
© 1994–2012 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without
notice. The only warranties for HP products and services are set forth in the express warranty statements accompanying such
products and services. Nothing herein should be construed as constituting an additional warranty. HP shall not be liable for
technical or editorial errors or omissions contained herein.
HP and Service Manager are registered trademarks of Hewlett-Packard Development Company, L.P. JavaScript is a
registered trademark of Sun Microsystems, Inc. in the United States and other countries.