Troubleshoot > Troubleshooting: Server startup > Troubleshooting: Failed to initialize or attach to shared memory environment (Windows only)

Troubleshooting: Failed to initialize or attach to shared memory environment (Windows only)

If the Service Manager server does not start and you receive a "Failed to initialize or attach to shared memory environment" error message, then your Windows system has one of two issues:

  • There is not enough free contiguous memory available to initialize Service Manager
  • The address Service Manager attempted to use for shared memory was already in use by a shared library (DLL), dynamic memory (heap), or another data structure

Review the sm.log file and search for one of the following RTE error messages:

Type of error Error Message
Insufficient free memory RTE E Error 8 in call MapViewOfFileEx - Not enough storage is available to process this command.
Address already in use RTE E Error 487 in call MapViewOfFileEx - Attempt to access invalid address.

Insufficient free memory

Out-of-box, Service Manager analyzes the memory layout of the process address space and identifies free memory ranges big enough to hold shared memory. If Service Manager could not find any contiguous piece of memory large enough to contain your Service Manager shared memory, the system fails to start with the following error messages:

RTE E Error 8 in call MapViewOfFileEx - Not enough storage is available 
to process this command.
...
RTE E No valid shared_memory_address parameter setting was found for a 
shared memory size of nnnnnnnnnn (NNNN MB)

In order to fix this issue, you must reduce the amount of shared memory.

Address already in use

When a Service Manager process attaches to shared memory, it has to use the same address as the shared memory was originally created with. The process might find that that address is already occupied by another data structure such as a DLL or dynamic memory (heap). The same scenario might happen if you use the shared_memory_address parameter, but the address specified in the parameter is already occupied.

If you had previously specified a shared memory address with the shared_memory_address parameter, HPE recommends you remove the parameter and have Service Manager automatically determine a suitable memory address. The current best practice is to only specify a shared_memory_address value if the automatic assignment fails.

After this type failure, the system will scan your system memory searching for a memory range that is large enough to contain Service Manager's shared memory. If the scan finds a suitable memory range it lists it in the log file with the following RTE information messages:

6116(  2716) 03/05/2010 11:06:41  RTE E shmat: MapViewOfFileEx failed
6116(  2716) 03/05/2010 11:06:41  RTE E Error 487 in call MapViewOfFileEx - Attempt to access invalid address.
6116(  2716) 03/05/2010 11:06:41  RTE E sm_init: shmat( 516, 0x73000000, 0 ) failed for size 67108864 and key 0x2A02E500
6116(  2716) 03/05/2010 11:06:41  RTE I List of possible shared_memory_address parameter settings for a shared memory size of 67108864 (64 MB)
6116(  2716) 03/05/2010 11:06:41  RTE I # Free range 0x7FFF0000-0xFFFAD000 size=2147209216 (2047 MB)
6116(  2716) 03/05/2010 11:06:41  RTE I Preferred        : shared_memory_address:0x80000000
6116(  2716) 03/05/2010 11:06:41  RTE I Lowest available : shared_memory_address:0x80000000
6116(  2716) 03/05/2010 11:06:41  RTE I Highest available: shared_memory_address:0xFBFA0000
6116(  2716) 03/05/2010 11:06:41  RTE I For a complete list of available shared_mempory_address settings, run with the debugvmmap parameter.
6116(  2716) 03/05/2010 11:06:41  RTE W !!! Use the preferred shared_memory_address parameter above
6116(  2716) 03/05/2010 11:06:41  RTE W !!! or remove the shared_memory_address parameter completely.
6116(  2716) 03/05/2010 11:06:41  RTE E HP Service Manager is unable to start. Failed to initialize or attach to shared memory environment

The scan lists three possible shared_memory_address values. The first memory address is the preferred shared_memory_address value. This address is the least likely to already be in use by a Windows or Service Manager shared library (DLL), dynamic memory (heap), or another data structure. The next address is the lowest possible address within this range you can use for shared memory. The last address is the highest possible address within this range you can use for shared memory. Pick one of these values for your shared_memory_address and test to see if the system starts.

If your system continues to fail with the address already in use error, you can start the server with the debugvmmap parameter to see a complete list of all address ranges large enough to contain shared memory as well as an address map of all the files that are currently using system memory. The list of memory ranges are in order of suggested use. The address ranges at the top of the list are better candidates than those at the bottom of the list. Within each address range there is a recommended address, lowest possible address, and highest possible address.

2724(  3572) 03/05/2010 11:06:38  RTE I List of all possible shared_memory_address parameter settings for a shared memory size of 67108864 (64 MB)
2724(  3572) 03/05/2010 11:06:38  RTE I # Free range 0x7FFF0000-0xFFFAD000 size=2147209216 (2047 MB)
2724(  3572) 03/05/2010 11:06:38  RTE I Preferred        : shared_memory_address:0x80000000
2724(  3572) 03/05/2010 11:06:38  RTE I Lowest available : shared_memory_address:0x80000000
2724(  3572) 03/05/2010 11:06:38  RTE I Highest available: shared_memory_address:0xFBFA0000
2724(  3572) 03/05/2010 11:06:38  RTE D # Free range 0x122B5000-0x30000000 size= 500477952 ( 477 MB)
2724(  3572) 03/05/2010 11:06:38  RTE D                    shared_memory_address:0x20000000
2724(  3572) 03/05/2010 11:06:38  RTE D Lowest available : shared_memory_address:0x122D0000
2724(  3572) 03/05/2010 11:06:38  RTE D Highest available: shared_memory_address:0x2C000000
...
2724(  3572) 03/05/2010 11:06:38  RTE D # Free range 0x77DF0000-0x7C360000 size=  72810496 (  69 MB)
2724(  3572) 03/05/2010 11:06:38  RTE D                    shared_memory_address:0x77E00000
2724(  3572) 03/05/2010 11:06:38  RTE D Lowest available : shared_memory_address:0x77E00000
2724(  3572) 03/05/2010 11:06:38  RTE D Highest available: shared_memory_address:0x78360000
2724(  3572) 03/05/2010 11:06:38  RTE D # Free range 0x039B0000-0x10000000 size= 207945728 ( 198 MB)
2724(  3572) 03/05/2010 11:06:38  RTE D                    shared_memory_address:0x039C0000
2724(  3572) 03/05/2010 11:06:38  RTE D Lowest available : shared_memory_address:0x039C0000
2724(  3572) 03/05/2010 11:06:38  RTE D Highest available: shared_memory_address:0x0C000000
2724(  3572) 03/05/2010 11:06:38  RTE W !!! Use the preferred shared_memory_address parameter above
2724(  3572) 03/05/2010 11:06:38  RTE W !!! or remove the shared_memory_address parameter completely.
2724(  3572) 03/05/2010 11:06:38  RTE E HP Service Manager is unable to start. Failed to initialize or attach to shared memory environment

If the system cannot find any suitable memory ranges, it lists the following RTE error message:

RTE E No valid shared_memory_address parameter setting was found for a 
shared memory size of nnnnnnnnnn (NNNN MB)

If there are no suggested shared memory parameters, you must reduce the amount of shared memory.