Tech Note 732 - Wonderware Memory Manager Configuration Best Practices
Tech Note 732 - Wonderware Memory Manager Configuration Best Practices
All Tech Notes, Tech Alerts and KBCD documents and software are provided "as is" without warranty of any kind. See the Terms of Use for more information.
Topic#: 002507
Created: October 2010
Updated: August 2012
Introduction
This Tech Note describes configuring the Wonderware Memory Manager.
If you are using InTouch 10.5 or later, go to the Using InTouch Application Manager to Configure Memory Allocation section.
Memory Manager is configured in the InTouch Application Manager for these versions only. You can ignore the rest of the Tech
Note.
If you are using earlier InTouch versions, go to the Non-Windows 2008 or Windows 2008 sections.
Summary
The Wonderware Memory Manager provides a mechanism for one or more programs to share virtual memory. The shared virtual memory
is located at the same virtual address within each program. The memory is shared by using memory mapped files which are forced to
specific virtual memory addresses. This forced mapping can become a problem if one of the programs does not have the virtual memory
address available that is already in use by some of the other programs for sharing the memory.
The Wonderware Memory Manager was previously hard coded to occupy a maximum memory range. For many years this memory range
was 256 MB, but recently it was increased to as much as 2048 MB, because of the heavy memory consumption of certain applications.
The default maximum memory range for the Wonderware Memory Manager remains at 256 MB.
You can configure the range of the Wonderware Memory Manager in 1 MB increments from 1 MB all the way up to 2048 MB. Any value
less than 1 MB will be set to 1 MB and any amount larger than 2048 MB will be set to 2048 MB, except for the value of 0 MB, which will
set the memory range to its default value of 256 MB.
It will be very obvious if you have set the memory range too low: The Wonderware Memory Manager will send messages to the
ArchestrA logger indicating it has run out of memory.
Note: This procedure should only be done by someone who is familiar with modifying the Windows Registry.
Application Versions
Using InTouch Application Manager to Configure Memory Allocation (InTouch 10.5 and later)
1. Click Start/Programs/Wonderware/InTouch
Note: See the Configure Memory Start Address section for more information.
Configuring Memory Range in Non-Windows 2008 Systems (InTouch 10.1 and earlier)
Create a DWORD registry entry with the value MemoryRange under the following key and set it to the maximum number of megabytes
(MB) you want the Wonderware Memory Manager to allow:
file:///C|/inetpub/wwwroot/t002507/t002507.htm[8/24/2012 2:22:40 PM]
Wonderware Memory Manager Configuration Best Practices
HKEY_LOCAL_MACHINE:Software\Wonderware\wwHeap
The default value of 256 will be used if no registry value is present, or when the registry value is set to 0.
Example
"MemoryRange"=dword:00000200 sets the memory range to 200 Hex = 512 MB (megabytes)
The sample registry file for 512 MB can look like the following:
[HKEY_LOCAL_MACHINE\SOFTWARE\Wonderware\wwHeap]
"MemoryRange"=dword:00000200
"BaseOffset"=dword:21000000
"ConserveMemory"=dword:00000001
The memory range will be written to the ArchestrA logger. You will see a line similar to below in the logger:
You can download the Sample Registry files and rename them to *.reg after the file is unzipped, or you can add it manually to the
registry.
Configuring the Memory Range in Windows 2008 Systems (InTouch 10.1 and earlier)
Create a DWORD registry entry with the value MemoryRange under the following key and set it to the maximum number of megabytes
(MB) you want the Wonderware Memory Manager to allow:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Wonderware\wwHeap
The default value of 256 will be used if no registry value is present or the registry value is set to 0.
Example
"MemoryRange"=dword:00000200 will set the memory range to 200 Hex = 512 MB (megabytes)
"MemoryRange"=dword:00000400 will set the memory range to 400 Hex = 1 Gig (Gigabytes) = 1024 MB
"MemoryRange"=dword:00000800 will set the memory range to 800 Hex = 2 Gig (Gigabytes) = 2048 MB
The sample of registry file for 1024 MB can look like below:
The memory range will be written to the ArchestrA logger. You will see a line similar to below in the logger:
You can download the Sample of Registry files and rename them to *.reg after the file is unzipped from link or add it manually to
the registry.
The default starting address is 0x21000000. The starting address will be forced lower than the user-specified address if the range of the
Wonderware Memory Manager's memory would be pushed past the end of the permitted application virtual address space, which is
typically about 0x7FFF0000.
Previous versions of the Wonderware Memory Manager had a start address at 0x50000000, but experience has shown that many
Microsoft dynamic link libraries and Visual Basic runtime components are now located at this address, so the decision was made to lower
the address to its new default of 0x21000000. The start and end memory addresses will be written to the ArchestrA logger.
Create a DWORD registry entry with the value BaseOffset under the following key and set it to the desired memory base offset:
HKEY_LOCAL_MACHINE:Software\Wonderware\wwHeap
The default value is 0x21000000 if no value is present or if the registry value is set to 0.
http://technet.microsoft.com/en-us/library/bb124810(EXCHG.65).aspx
2GB heap is allowed 32765 maps, slightly less than 2GB (192 KB less).
For full wwHeap range, the starting address is forced down to the minimum application starting address.
For full wwHeap range, the starting address is forced down to 0x407E0000, if specified to be larger.
In the case where the InTouch application is using a lot of memory and the Wonderware Memory Manager's memory range is set to a
larger value, such as 512 MB or more, it can be very inefficient to have the free memory search algorithm start at the beginning memory
address each time it searches for an available memory block. As a result, a registry entry can be created that causes the memory
manager to start searching for a free memory block at an index AFTER the most recently located free memory block
In either case, if the memory manager cycles through this list twice without locating a suitable range of free memory, then the
Wonderware Memory Manager will generate an out of memory message.
The disadvantage to cycling through all of the memory is that ALL of the Wonderware Memory Manager's memory range will eventually
be used, if even for a brief while. This can have a negative effect if some DLL are transient within the Wonderware Memory Manager's
memory range. This has been observed most often with InTouch applications that exhibit heavy window cycling or recipe usage.
By default, the Wonderware Memory Manager will recycle' lower memory blocks and search for free memory from the base offset for
each memory request. To enable the efficient free-memory search algorithm create a DWORD registry entry with the value
ConserveMemory under the following key And set the value to 0 to cycle through the list or set it to 1 to always start the search at the
beginning of the list:
HKEY_LOCAL_MACHINE:Software\Wonderware\wwHeap
The default value is 1 if no value is present or if the value is not 0. The status of the memory conservation will be written to the
ArchestrA logger.
In this particular case, you can specify that a configuration file be read during the start sequence of the Wonderware Memory Manager.
This file will contain entries which describe the memory ranges which the Wonderware Memory Manager is to avoid.
The memory reservation file is a text file in the simple INI file format. This makes it very easy to read by humans and to edit with a
simple text processing tool such as Notepad.Exe.
1. Create a REG_SZ (string) registry entry with the value ReserveFilePath under the following key:
HKEY_LOCAL_MACHINE:Software\Wonderware\wwHeap
2. Set the value to the full file path of the .ini file containing the desired memory reservation entries. The default is to not process
any file if the value is absent.
A warning is not generated if the file is missing or can not be processed. If the reservation file path is detected in the registry, then its
file path is written to the ArchestrA logger – whether the file is valid, exists or not, or was actually processed or not.
A start address
Followed by a dash
Control characters and spaces are stripped from the input string. The memory addresses must end on 64K boundaries – meaning the
lower 4 bytes of the address are zero.
For example:
MEM00002=0x25000000-0x33450000
For example:
MEM00004=0x25000000;16
File Format
The file is in .ini file format, with the section ReserveMemory receiving the processing. The processor will search for memory entries
MEM00000 through a maximum of MEM16384, where the numbers are in decimal.
Each entry is checked, so when you make the file, they do not have to be sequential in order, merely unique. If you want the processing
to finish more quickly, then create a ‘DONE' entry as follows “MEM00005=DONE” and the processing will stop as soon as that entry is
observed.
Any entries lower than the memory range or greater than the memory range are ignored. No warning messages are generated for
entries which are not processed or contain syntactical errors.
Example File
[ReserveMemory]
MEM00000=0x25000000-0x33450000
MEM00001=0x45000000;8
MEM00002=0x50000000;16
MEM00003=DONE
1. Create a REG_DWORD registry entry with the value DumpSharedMapWhenFull under the following key.
HKEY_LOCAL_MACHINE:Software\Wonderware\wwHeap
The file will be written to the current user's temporary folder, and it will have the file name WWHeapShareDump.txt unless a registry
entry is created to generate a new file name each time.
To enable the diagnostic file generation to create a new file each time
1. Create a REG_DWORD registry entry with the value DumpSharedMapToNewFile under the following key.
2. Set it to a non-zero value to enable the file dumping to a different file name each time.
HKEY_LOCAL_MACHINE:Software\Wonderware\wwHeap
The files will have the name WWHeapShareDumpXXXXXXXX.txt where the XXXXXXXX is replaced with a number, such as 00000000,
00000001, 00000002, etc.
To enable the diagnostic file generation to create a new process data file each time
1. Create a REG_DWORD registry entry with the value DumpSharedProcessDataToNewFile under the following key.
2. Set it to a non-zero value to enable the file dumping to a different file name each time:
HKEY_LOCAL_MACHINE:Software\Wonderware\wwHeap
The files will have the name WWHeapSharedProcessDumpXXXXXXXX.Txt where the XXXXXXXX is replaced with a number, such as
00000000, 00000001, 00000002, etc.
K. Nourbakhsh
Tech Notes are published occasionally by Wonderware Technical Support. Publisher: Invensys Systems, Inc., 26561 Rancho Parkway South, Lake Forest, CA 92630. There is also
technical information on our software products at Wonderware Technical Support.
Back to top
©2012 Invensys Systems, Inc. All rights reserved. No part of the material protected by this copyright may be reproduced or utilized in any form or by any means, electronic or
mechanical, including photocopying, recording, broadcasting, or by anyinformation storage and retrieval system, without permission in writing from Invensys Systems, Inc.
Terms of Use.