|Title: ||Using memory windows on HP-UX|
|Author: ||Michael Marxmeier (firstname.lastname@example.org)|
|Keywords: ||FAQ,hpux,mmap,setmemwindow,memory window,eloqdb6|
Using memory windows on HP-UX
Eloquence supports the HP-UX specific "memory window"
option that allows to overcome the sysstem wide 1.75 GB
address space restriction on shared mappings for 32
bit processes. Typically less than the max. size is
This option may be required if starting the Eloquence database
server fails with an error message like below:
Unable to mmap buffer cache: Not enough space (errno 12)
shmget: Not enough space (errno 12)
Each Eloquence database server instance typically allocates two shared
memory objects. A buffer cache of the configured size and a communication
buffer that uses 32 KB for each configured concurrent connection plus some
When not using memory windows, both memory objects are created in a
global address space and account against the limit.
With memory windows, the Eloquence database will use a private
address space for its buffer cache and only use the global area
for its communication buffer.
To enable memory window support on HP-UX the
max_mem_window kernel parameter needs to be
set to a non-zero value. It should be set to (at least)
the number of Eloquence database instances on the system.
Then set the ELOQDB6_PFX[x] variable to
"setmemwindow -n" in the Eloquence startup
configuration file (/etc/rc.config.d/eloquence6)
for each eloqdb6 instance. For example:
This causes the eloqdb6 process to use a private memory
window for its buffer cache when the eloqdb6 process is
To restart the server processes please execute (as root):
Specifying the memory window id
The setmemwindow -n command as shown above uses the next unused
memory window when the server is started. With the additional -i
option to setmemwindow it is possible to specify a numeric
window id for a memory window and request this specific memory window to
be re-used for this database server instance. If the -i option is
used, each spcified id number needs to be unique and should not conflict
with any other memory window id specified in /etc/services.window.
ELOQDB6_RUNPFX="setmemwindow -n -i10"
ELOQDB6_RUNPFX="setmemwindow -n -i20"
Starting the Eloquence database could fail with an error
message like below if the max_mem_window does not allow
for sufficient memory windows:
setmemwindow -n /opt/eloquence6/bin/eloqdb6
The setmemwindow man page has the following definition of the
setmemwindow exit codes:
The failure to create a specific window may be the effect of
the lack of available memory windows - the underlying kernel has not
been configured with enough memory windows (exit status ENOMEM) or the
feature is not implemented (exit status ENOSYS).
An exit status of 12 would indicate ENOMEM.
As a memory window is only released when all processes using a memory
window have exited i think it is worth testing if any "leftover"
eloqdb6 processes exist. Usually this should not happen as the
start/stop script takes care of them.
Please do a ps as below:
ps -ef|fgrep eloqdb6
The PPID column (3rd column) should be 1 for the main eloqdb6
process for an instance. There should be no eloqdb6 processes
with a PPID of 1 and a process title "eloqdb6: io thread ..."
Unfortunately there is no easy way to see what process is using
a specific memory window with the standard HP-UX tools.
HP has published the unsupported shminfo utility that may be used
to obtain some information if/to what extent memory windows are in
use. However it does not seem to return process information.
You can download it (along with a short description) from
Login as contrib. Password 9unsupp8.
# shminfo -p
Shared space from Window id -2147483648:
Space Start End Kbytes Usage
Q2 0x0e9ab400.0x40000000-0x7fffffff 1048576 FREE
Q3 0x08bbec00.0x80000000-0x9f407fff 512032 OTHER
Q3 0x08bbec00.0x9f408000-0xbfffffff 536544 FREE
This would be a typical output for Eloquence in a memory window.
The Eloquence buffer cache (512 MB here) is shown as "OTHER".
All 'private' memory windows (not created by specifying a memory
window id with setmemwindow) use the id of -2147483648 (0x80000000).