cancel
Showing results for 
Search instead for 
Did you mean: 

Shared Memory error

Larrhy-Martin
Occasional Visitor

Shared Memory error

Hello,

I urgently need your help to solve this : running on an HP-UX server 11.11 a process that loads from a database Xref files to the shared memory, I have the following error : Illegal Shared Memory Size -2140822496.
From the log of the process, I notice that the files loading stops at a file that might be above 2Gb.
What can be the reason of this ? The shared memory can not contain a file bigger than 2Gb ? Is there any tunable kernel parameter related to this ? My RAM is 16Gb and below, my Kernel params.

root@rating2:/root#kmtune
Parameter Current Dyn Planned Module Version
===============================================================================
NSTRBLKSCHED - - 2
NSTREVENT 50 - 50
NSTRPUSH 16 - 16
NSTRSCHED 0 - 0
STRCTLSZ 1024 - 1024
STRMSGSZ 65535 - 65535
acctresume 4 - 4
acctsuspend 2 - 2
aio_listio_max 256 - 256
aio_max_ops 2048 - 2048
aio_physmem_pct 10 - 10
aio_prio_delta_max 20 - 20
allocate_fs_swapmap 0 - 0
alwaysdump 1 - 1
bcvmap_size_factor 2 - 2
bootspinlocks - - 256
bufcache_hash_locks 128 - 128
bufpages 0 - (NBUF*2)
chanq_hash_locks 256 - 256
core_addshmem_read 0 Y 0
core_addshmem_write 0 Y 0
create_fastlinks 0 - 0
dbc_max_pct 5 - 5
dbc_min_pct 2 - 2
default_disk_ir 0 - 0
desfree - - 0
disksort_seconds 0 - 0
dmp_max_msecs 10000 - 10000
dmp_pathsw_bshift 10 - 10
dmp_rootdev_is_vol 0 - 0
dmp_swapdev_is_vol 0 - 0
dnlc_hash_locks 512 - 512
dontdump 0 - 0
dskless_node - - 0
dst 1 - 1
effective_maxpid - - ((NPROC<=30000)?30000:(NPROC*5/4))
eisa_io_estimate - - 0x300
enable_idds 0 - 0
eqmemsize 15 - 15
executable_stack 1 - 1
fcp_large_config 0 - 0
file_pad - - 10
fs_async 0 - 0
ftable_hash_locks 64 - 64
hdlpreg_hash_locks 128 - 128
hfs_max_ra_blocks 20 - 20
hfs_max_revra_blocks 8 - 8
hfs_ra_per_disk 256 - 256
hfs_revra_per_disk 64 - 64
hp_hfs_mtra_enabled 1 - 1
hpux_aes_override - - 0
initmodmax 50 - 50
io_ports_hash_locks 64 - 64
iomemsize - - 40000
ksi_alloc_max 81920 - (NPROC*8)
ksi_send_max 32 - 32
lotsfree - - 0
max_async_ports 50 - 50
max_fcp_reqs 512 - 512
max_mem_window 0 - 0
max_thread_proc 2048 - 2048
maxdsiz 3221225472 - 3221225472
maxdsiz_64bit 274877906944 - 274877906944
maxfiles 2048 - 2048
maxfiles_lim 2048 Y 2048
maxqueuetime - - 0
maxssiz 134217728 - 134217728
maxssiz_64bit 1073741824 - 1073741824
maxswapchunks 16384 - 16384
maxtsiz 0x3ff00000 Y 0X3FF00000
maxtsiz_64bit 0xffff0000 Y 0XFFFF0000
maxuprc 9216 Y ((NPROC*9)/10)
maxusers 1024 - 1024
maxvgs 80 - 80
mesg 1 - 1
minfree - - 0
modstrmax 500 - 500
msgmap 10242 - (2+MSGTQL)
msgmax 32768 Y 32768
msgmnb 65536 Y 65536
msgmni 10240 - (NPROC)
msgseg 32767 - 32767
msgssz 128 - 128
msgtql 10240 - (NPROC)
nbuf 0 - 0
ncallout 17952 - (16+NKTHREAD)
ncdnode 150 - 150
nclist 16484 - (100+16*MAXUSERS)
ncsize 96064 - (NINODE+VX_NCSIZE)+(8*DNLC_HASH_LOCKS)
ndilbuffers 30 - 30
netisr_priority - - -1
netmemmax - - 0
nfile 155648 - (15*NPROC+2048)
nflocks 10240 - (NPROC)
nhtbl_scale 0 - 0
ninode 83968 - (8*NPROC+2048)
nkthread 17936 - (((NPROC*7)/4)+16)
nni - - 2
no_lvm_disks 0 - 0
nproc 10240 - (2048+8*MAXUSERS)
npty 200 - 200
nstrpty 200 - 200
nstrtel 60 - 60
nswapdev 10 - 10
nswapfs 10 - 10
nsysmap 20480 - ((NPROC)>800?2*(NPROC):800)
nsysmap64 20480 - ((NPROC)>800?2*(NPROC):800)
o_sync_is_o_dsync 0 - 0
page_text_to_local - - 0
pfdat_hash_locks 128 - 128
public_shlibs 1 - 1
region_hash_locks 128 - 128
remote_nfs_swap 0 - 0
rtsched_numpri 32 - 32
scroll_lines 100 - 100
scsi_max_qdepth 8 Y 8
scsi_maxphys 1048576 - 1048576
select_enh 0 Y 0
sema 1 - 1
semaem 16384 - 16384
semmap 10242 - (SEMMNI+2)
semmni 10240 - (NPROC)
semmns 20480 - (SEMMNI*2)
semmnu 10236 - (NPROC-4)
semmsl 2048 Y 2048
semume 512 - 512
semvmx 32767 - 32767
sendfile_max 0 - 0
shmem 1 - 1
shmmax 0x3ffe00000 Y 0X3FFE00000
shmmni 1024 - 1024
shmseg 768 Y 768
st_ats_enabled 0 - 0
st_fail_overruns 0 - 0
st_large_recs 0 - 0
st_san_safe 0 - 0
streampipes 0 - 0
swapmem_on 1 - 1
swchunk 2560 - 2560
sysv_hash_locks 128 - 128
tcphashsz 0 - 0
timeslice 10 - (100/10)
timezone 420 - 420
unlockable_mem 0 - 0
vas_hash_locks 128 - 128
vnode_cd_hash_locks 128 - 128
vnode_hash_locks 128 - 128
vol_checkpt_default 10240 - 10240
vol_dcm_replay_size 262144 - (256*1024)
vol_default_iodelay 50 - 50
vol_fmr_logsz 4 - 4
vol_max_bchain 32 - 32
vol_max_nconfigs 20 - 20
vol_max_nlogs 20 - 20
vol_max_nmpool_sz 4194304 - (4*1024*1024)
vol_max_prm_dgs 1024 - 1024
vol_max_rdback_sz 4194304 - (4*1024*1024)
vol_max_vol 8388608 - (8*1024*1024)
vol_maxio 256 - 256
vol_maxioctl 32768 - 32768
vol_maxkiocount 2048 - 2048
vol_maxparallelio 256 - 256
vol_maxspecialio 256 - 256
vol_maxstablebufsize 256 - 256
vol_min_lowmem_sz 524288 - (512*1024)
vol_mvr_maxround 256 - 256
vol_nm_hb_timeout 10 - (10)
vol_subdisk_num 4096 - 4096
vol_vvr_transport 1 - (1)
vol_vvr_use_nat 0 - (0)
volcvm_cluster_size 16 - 16
volcvm_smartsync 1 - 1
voldrl_max_drtregs 2048 - 2048
voldrl_min_regionsz 512 - 512
voliomem_chunk_size 65536 - (64*1024)
voliomem_maxpool_sz 4194304 - (4*1024*1024)
voliot_errbuf_dflt 16384 - 16384
voliot_iobuf_default 8192 - 8192
voliot_iobuf_limit 131072 - 131072
voliot_iobuf_max 65536 - 65536
voliot_max_open 32 - 32
volraid_rsrtransmax 1 - 1
vps_ceiling 64 - 64
vps_chatr_ceiling 1048576 - 1048576
vps_pagesize 4 - 4
vx_fancyra_enable 0 - 0
vx_maxlink 32767 - 32767
vx_ncsize 8000 - 8000
vx_ninode 0 - 0
vxfs_max_ra_kbytes 1024 - 1024
vxfs_ra_per_disk 1024 - 1024
vxtask_max_monitors 32 - 32
x25_setup_pvc_timer - - 0


Thanks to all !
2 REPLIES
Dennis Handly
Acclaimed Contributor

Re: Shared Memory error

>a process that loads from a database Xref files to the shared memory, I have the following error: Illegal Shared Memory Size -2140822496.

This application is broken. It should not be treating shmmax as a signed int, it should be unsigned in or unsigned long long.

(gdb) p /x -2140822496 -> 0x8065a420
(gdb) p (unsigned int)-2140822496 -> 2154144800
(Unfortunately I can't see how that number comes from your shmmax 0x3ffe00000?

>Is there any tunable kernel parameter related to this?

You might have to reduce shmmax if you can't get your application fixed.

>The shared memory can not contain a file bigger than 2Gb?

Note a 32 bit application can't really get a segment above 1 Gb.
Steven E. Protter
Exalted Contributor

Re: Shared Memory error

Shalom,

set shmmax as big as you can, up to 16 GB and that should resolve the problem.

Some of the parameters on this system appear to be default.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com