MEMADVISE(2) — Series 500 Only
NAME
memadvise − advise OS about segment reference patterns
SYNOPSIS
#include <sys/ems.h>
#include <sys/types.h>
memadvise(addr, len, behav, adrtype)
caddr_taddr;
intlen, behav;
enummemtype {mem_code, mem_data} adrtype;
HP-UX COMPATIBILITY
Level: Backing Store Control - HP-UX/EXTENDED
Origin: HP
Remarks: Memadvise is not currently implemented on the Series 200.
DESCRIPTION
The purpose of this call is to allow an application program to notify the system of its known patterns of reference in specific areas of process memory. The intent is to allow the system to then adapt its memory management algorithms and/or policies based on this knowledge to maximize the performance of the program. For example, a program that uses a very large hash table might inform the system of its random patterns of reference to this area. The system might, then, elect not to do any pre-fetching or clustered reads in this area.
Addr is the starting address of the area in question and len is the length in bytes. Addr may be any legal address in the process’s address space. Since some implementations use different (and indistinguishable) addressing formats for code and data space, adrtype is used to indicate whether addr is a code or data address. On systems with a uniform addressing format for code and data, adrtype will have no effect.
The boundaries of the address space for which the advice is applied may be rounded up and/or down to appropriate system dependent values (e.g. pages, segments, blocks, etc).
Variable behav describes the reference pattern in the specified area:
MEM_NORMAL
No known extraordinary patterns of reference.
MEM_SEQ
References are highly sequential in nature.
MEM_RANDOM
References are totally random and unpredictable.
MEM_NEEDED
Area is expected to be highly referenced in near future.
MEM_NOTNEEDED
Area is not expected to be referenced in the near future.
Memadvise may be reduced to a no-op, or some of the behavior types may be ignored (treated as no-ops).
HARDWARE DEPENDENCIES
This system call is supported on Series 500 only.
SEE ALSO
Hewlett-Packard — last mod. May 11, 2021