Shared Memory Best Practices Guide V1.0
Shared Memory Best Practices Guide V1.0
Version 1.0
December 2014
Change Summary
Teamcenter
Teamcenter Server2
Server1 Shared Memory
Text Server Data
Site Preference Data
Localized LOV Data
Metadata
Server1 Address Space
Server2 Address Space
Large amount of data are loaded into shared memory. These data include text server data, site preference
data, localized LOV data and metadata. As a result, private memory footprint for a server process is
reduced. For example, in a Teamcenter 9.1.2 environment, the savings in the private memory footprint for a
server process are as follows:
TextServer ~6MB
Preferences ~2-4MB
LOV ~5MB
Metadata ~19MB
Since private memory footprint is reduced per server, more Teamcenter servers can be configured on the
same machine than previously.
Shared Memory
No Text Server Data
Site Preference Data
Populate shared data to shared memory Localized LOV Data
Mark initialization completed Metadata
Yes
2. The server that is granted to proceed creates shared memory directory and shared memory module sub-
directories if they do not exist.
Shared memory modules are TextSrv, Preferences, LOV and Metadata. In a shared memory module sub-
directory, backing-store files are stored.
See Section 3.1.1 Backing-Store File Directory Structure
3. The server creates the shared memory pool (segment) using the full path name of the backing store file for a
shared memory module (e.g. TextSrv).
4. The server populates shared data to shared memory if it is not yet initialized.
Once the shared memory is populated, shared memory data is saved to the backing-store file. In the above
figure, the two actions highlighted in blue are executed only once by one server.
5. The server releases the named semaphore to allow a waiting server to proceed from Step 2.
TC_VERSION_STRING Sub-directory
In the root directory, a sub-directory is created using TC_VERSION_STRING, which is defined by
Teamcenter for each release version.
SiteId Sub-directory
TC_VERSION_STRING subdirectory consists of the sub-directories created using Site Id per Database
TC_VERSION_STRING
SiteId
TextSrv
tc_text.xml.mem
emh_text.xml.mem
Preferences
SharedSitePrefs.mem
LOV
LOVDictionarySegmentN.mem
LOVMasterSegment.mem
Metadata
MetadataCacheSegmentN
MetadataMasterSegment.mem
It should be noted the shared memory for LOV and Metadata supports multiple versions of shared memory data (i.e.
shared memory segments). One backing-store file is created per segment. N in the backing-store file name for a
segment represents the version number of the segment. Another backing-store file, a.k.a. Master Segment backing-
store file is created for LOV and Metadata module respectively. This backing-store file is used for tracking the version
number of the latest active shared memory segment. For the details, please refer to Section 3.4 Shared Memory for
Localized LOV Data and Section 3.5 Shared Memory for Metadata.
In Teamcenter release 11.2, the backing-store file for a segment is named as VersionN.mem, and the Master
Segment backing-store file is named as Master.mem. Shared memory for site preference data will also support
multiple versions of shared memory data. The following figure illustrates these changes.
TC_VERSION_STRING
SiteId
TextSrv
tc_text.xml.mem
emh_text.xml.mem
Preferences
SharedSitePrefsN.mem
PREFMasterSegment.mem
LOV
VersionN.mem
Master.mem
Metadata
VersionN.mem
Master.mem
Shared memory for site preferences is updated by a subsequent server if any site preferences are modified after
shared memory population.
In Teamcenter release 11.2, shared memory for site preferences will be made read-only and will support
multiple versions of shared memory data.
2. Each subsequent server that is granted to proceed retrieves the latest version number from database for
localized LOV data.
3. If the latest version number is greater than the version number cache in LOV Master segment, the server
creates a new shared memory segment using the full path name of the new backing store file.
4. The server populates latest localized LOV data to the new shared memory segment, and updates LOV
Master segment with the latest version number.
5. Each existing server will be switched to the latest shared memory segment upon its next access to shared
memory LOV data.
Similar to Shared Memory for Localized LOV Data, the shared memory metadata implementation also supports
multiple shared memory segments for representing multiple versions of metadata. For this purpose, the backing-store
file: MetadataMasterSegment.mem (Master.mem in Teamcenter release 11.2) is created and saved. This backing-
store file stores the version number of the latest active shared memory segment for metadata. Each shared memory
segment for metadata is created and used in the same way as it is done for Shared Memory for Localized LOV Data.
3. Clean up Semaphores
You may need to clean up semaphores that are not released by Teamcenter processes.
Teamcenter recommends the environment variable: TC_SHARED_MEMORY_DIR is set to a valid directory and it
should not be changed.
It should be noted in Teamcenter release 11.2, if the shared memory population fails, Teamcenter server will report
the error and not fall-back to the in-process memory mode. Specifically, one of the following errors (to name a few)
will be reported:
Unable to create pool lock
In the above error message, "%1$" will be substituted on the fly with a specific shared memory module name,
e.g. LOV or Metadata
In the above error message, "%1$-%2$" will be substituted on the fly with a specific shared memory module
name and the backing-store file name respectively, e.g. Metadata - Master
In the above error message, "%1$" will be substituted on the fly with the metadata cache dataset version
number, and "%2$" will be substituted on the fly with the metadata version number.
Please refer to Section 5 Troubleshoot Shared Memory Problems for the details on how to resolve these errors.
Whenever one of the above scenarios occurs, Teamcenter recommends you manually remove the backing-store files
in the TextSrv directory (See 3.1.1 Backing-Store File Directory Structure) to refresh shared memory text server
cache. The detailed steps are as follows:
Whenever one of the above scenarios occurs, Teamcenter recommends you take one of the following options to
refresh shared memory preference cache.
1. Existing users can refresh preferences from RAC or may choose to relogin.
2. The system administrator can manually remove the backing-store files in the Preferences directory.
Whenever one of the above scenarios occurs, Teamcenter recommends you take one of the following options to
refresh shared memory cache for LOV. The first option is recommended.
1. The system administrator can start a Teamcenter server or run a utility (e.g. list_users).
The new Teamcenter process will create a new shared memory segment for the latest localized LOV data.
The existing servers will then be switched to the new shared memory segment when a subsequent access to
localized LOV data is made.
3. The system administrator can manually remove the backing-store files in the LOV directory.
Note you must manually run the utility: generate_metadata_cache to generate the latest metadata cache if
you have not chosen the server cache generation option when performing the above actions.
4. You have modified TC_DATA\structure_alias.xml to configure properties for intermediate data capture (IDC)
objects in the Multi-Structure Manager.
Note you must manually run the utility: generate_metadata_cache force to generate the latest metadata
cache for the configured properties of IDC objects.
Whenever one of the above scenarios occurs, Teamcenter recommends you take one of the following options to
refresh shared memory cache for Metadata. The first option is recommended.
1. The system administrator can start a Teamcenter server or run a utility (e.g. list_users).
The new Teamcenter process will create a new shared memory segment for the latest metadata cache. The
existing servers will then be switched to the new shared memory segment when a subsequent SOA call is
made.
This utility checks if any new metadata is deployed to database. This check is done periodically in terms of
the update interval setting specified by the preference:
TC_shared_server_metadata_cache_mgr_sleep_minutes. The default setting is 10 minutes. Once the
new metadata version is deployed to database, the utility retrieves the latest metadata from database to
generate a new shared metadata segment. The existing servers will then be switched to the new shared
memory segment when a subsequent SOA call is made.
4. The system administrator can manually remove the backing-store files in the Metadata directory.
When the above problem occurs, you need to clean up semaphores in the following steps:
2. Log on as root
After the semaphores are cleaned up, the newly-started Teamcenter processes will be able to get new semaphores
and populate or access the shared memory.
In the above error message, "%1$" will be substituted on the fly with the metadata cache dataset version
number, and "%2$" will be substituted on the fly with the metadata version number.
In the above error message, "%1$" will be substituted on the fly with a specific shared memory module name,
e.g. LOV or Metadata
In the above error message, "%1$-%2$" will be substituted on the fly with a specific shared memory module
name and the backing-store file name respectively, e.g. Metadata - Master
1. TC_NO_TEXTSRV_SHARED_MEMORY
Set it to TRUE to disable shared memory for text server data.
2. TC_USE_PREFS_SHARED_MEMORY
Set it to FALSE to disable shared memory for site preference data
3. TC_USE_LOV_SHARED_MEMORY
Set it to FALSE to disable shared memory for localized LOV data
4. TC_USE_METADATA_SHARED_MEMORY
Set it to FALSE to disable shared memory for metadata
If no metadata cache is pre-generated, the system will also disable shared memory for metadata. Therefore,
to disable shared memory for metadata, you may run the utility: generate_metadata_cache delete to delete
the metadata cache.
5. TC_SKIP_CLIENT_CACHE
At RAC machine, set TC_SKIP_CLIENT_CACHE=TRUE to turn off Client Metadata Cache for RAC so that
RAC will always retrieve metadata from server.