Did this article resolve your question/issue?



What is the default -shmsegsize value used when allocating shared memory segments?

« Go Back


TitleWhat is the default -shmsegsize value used when allocating shared memory segments?
URL NameP133127
Article Number000129728
EnvironmentProduct: OpenEdge
Version: 10.1B, 10.2x, 11.x
OS: All supported platforms
Question/Problem Description
When not using -shmsegsize, what is the default value used when allocating shared memory segments at database startup?
How does the shared memory allocation algorithm work when -shmsegsize is not used as a database startup parameter?
How to define the best shared memory segment size when starting a database ?
Steps to Reproduce
Clarifying Information
Error Message
Defect Number
Enhancement Number
OpenEdge 10.1B has three major changes with respect to how the Database Manager creates and uses database shared memory segments:
  1. The default shared segment size is different (and larger) than the previous fixed maximum of 128 megabytes for 32-bit systems.
  2. The database's data structures that are placed into shared memory are larger than they were in prior releases.  In particular, shared pointers are now 64 bit and they were 32 bit in prior releases.
  3. The -shmsegsize database startup parameter was added as a database startup parameter which allows control over the "maximum" segment size that will be created.
-shmsegsize: Minimum value  
  • 128 MB for 32-bit OpenEdge
  • 1024 MB for 64-bit OpenEdge
-shmsegsize: values (MB)
  • 32-bit OpenEdge: 128, 256, 512, 1024, 2048
  • 64-bit OpenEdge: 1024, 2048, 4096, 8192, 16384, 32768
Pre-OpenEdge 10.1B behaviour can be forced by adding "-shmsegsize 128" for OpenEdge 32-bit or "-shmsegsize 1g" or "-shmsegsize 1024" for OpenEdge 64-bit, to the database startup parameters.

Since OpenEdge 10.1B when the database startup parameter "-shmsegsize" is not specified, the database manager attempts to determine the best single shared memory segment size to use based on the shared memory the database server requests and rounds up to the next available value.  

Once the database has started, the number of shared memory segments and their size can be viewed. Refer to Article: If the code determines that a 2GB segment should be used, but the machine is configured for a maximum segment size of 1GB, a 1GB segment will be created and then 1 or more segments at the maximum size until the Shared memory requirements are met, where the last segment will be the smallest.

Increasing the size of the shared memory segments decreases the number of segments allocated, in turn decreasing the system resources needed to manage the segments. In general, use a shared memory segment size (-shmsegsize) to specify the size of the largest shared memory segment the server can allocate. However on 32-bit OpenEdge care should be exercised when more than 1GB of shared memory is used.  

A potential problem with allowing the Database Manager to allocate the shared memory segment size is that the database may fail to start or will start and clients may fail to connect self-service when the calculated shared memory size: For this reason, it is recommended to explicitly specify the shared memory segment size to use with the -shmsegsize database startup parameter as opposed to relying on the default calculation.  As a rough guide, add the sum of -B and -B2 and multiply by the database blocksize. Then use a valid shared memory segment size lower than the size that would be used if rounded up.

For example: 
(-B + -B2 ) x blocksize = 250000 x 4 = 1 GB
  • -shmsegsize = 2048 default, 1 shared memory segment. Due to other database's data structures (-L, -maxareas, -Mxs etc) pushing the shared memory requirement over 1GB, the next shared memory segment size used is 2g, so one shared memory segment is used with quite a lot of space free.
  • -shmsegsize = 1024, 3 shared memory segments will be used to satisfy the shared memory requirement with the last the last segment having the same amount of space free as above.
  • -shmsegsize = 512, 3 shared memory segments will be used to satisfy the shared memory requirement with the last the last segment having appreciable space free.
  • -shmsegsize = 256, 5 shared memory segments will be used to satisfy the shared memory requirement with the last segment having the least space free.
Last Modified Date11/20/2020 7:19 AM
Disclaimer The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.