# DbEnv.memp_stat |

`

###

    import com.sleepycat.db.*;

    public DbMpoolStat memp_stat(int flags)
        throws DbException;

    public DbMpoolFStat[] memp_fstat(int flags)
        throws DbException;

# Description

The DbEnv.memp_stat and DbEnv.memp_fstat methods return the memory pool subsystem statistics.

The flags value must be set to 0 or the following value:

Db.DB_STAT_CLEAR
  Reset statistics after returning their values.

The DbEnv.memp_stat and DbEnv.memp_fstat methods create the DbMpoolStat and DbMpoolFStat objects encapsulating the memory pool region statistics. The memory pool region statistics are stored in a DbMpoolStat object and the per-file memory pool statistics are stored in DbMpoolFStat objects. The following data fields are available from the DbMpoolStat object:

public long st_gbytes;
  Gigabytes of cache (total cache size is st_gbytes + st_bytes).
public long st_bytes;
  Bytes of cache (total cache size is st_gbytes + st_bytes).
public int st_ncache;
  Number of caches.
public int st_regsize;
  Individual cache size.
public int st_map;
  Requested pages mapped into the process' address space (there is no available information about whether or not this request caused disk I/O, although examining the application page fault rate may be helpful).
public int st_cache_hit;
  Requested pages found in the cache.
public int st_cache_miss;
  Requested pages not found in the cache.
public int st_page_create;
  Pages created in the cache.
public int st_page_in;
  Pages read into the cache.
public int st_page_out;
  Pages written from the cache to the backing file.
public int st_ro_evict;
  Clean pages forced from the cache.
public int st_rw_evict;
  Dirty pages forced from the cache.
public int st_page_trickle;
  Dirty pages written using the DbEnv.memp_trickle interface.
public int st_pages;
  Pages in the cache.
public int st_page_clean;
  Clean pages currently in the cache.
public int st_page_dirty;
  Dirty pages currently in the cache.
public int st_hash_buckets;
  Number of hash buckets in buffer hash table.
public int st_hash_searches;
  Total number of buffer hash table lookups.
public int st_hash_longest;
  The longest chain ever encountered in buffer hash table lookups.
public int st_hash_examined;
  Total number of hash elements traversed during hash table lookups.
public int st_hash_nowait;
  The number of times that a thread of control was able to obtain a hash bucket lock without waiting.
public int st_hash_wait;
  The number of times that a thread of control was forced to wait before obtaining a hash bucket lock.
public int st_hash_max_wait;
  The maximum number of times any hash bucket lock was waited for by a thread of control.
public int st_region_wait;
  The number of times that a thread of control was forced to wait before obtaining a region lock.
public int st_region_nowait;
  The number of times that a thread of control was able to obtain a region lock without waiting.
public int st_alloc;
  Number of page allocations.
public int st_alloc_buckets;
  Number of hash buckets checked during allocation.
public int st_alloc_max_buckets;
  Maximum number of hash buckets checked during an allocation.
public int st_alloc_pages;
  Number of pages checked during allocation.
public int st_alloc_max_pages;
  Maximum number of pages checked during an allocation.

The DbEnv.memp_fstat method creates an array of DbMpoolFStat objects containing statistics for individual files in the pool. Each DbMpoolFStat object contains statistics for an individual DbMpoolFile. The following data fields are available for each DbMpoolFStat object:

public String file_name;
  The name of the file.
public long st_pagesize;
  Page size in bytes.
public int st_cache_hit;
  Requested pages found in the cache.
public int st_cache_miss;
  Requested pages not found in the cache.
public int st_map;
  Requested pages mapped into the process' address space.
public int st_page_create;
  Pages created in the cache.
public int st_page_in;
  Pages read into the cache.
public int st_page_out;
  Pages written from the cache to the backing file.

The DbEnv.memp_stat method throws an exception that encapsulates a non-zero error value on failure.

# Errors

The DbEnv.memp_stat method may fail and throw an exception encapsulating a non-zero error for the following conditions:

EINVAL
  An invalid flag value or parameter was specified.

The DbEnv.memp_stat method may fail and throw an exception for errors specified for other Berkeley DB and C library or system methods. If a catastrophic error has occurred, the DbEnv.memp_stat method may fail and throw a DbRunRecoveryException, in which case all subsequent Berkeley DB calls will fail in the same way.

# Class

DbEnv, DbMpoolFile

# See Also

Memory Pools and Related Methods`

Copyright Sleepycat Software