DB_ENV->memp_trickle()
Prev | Chapter 8. The DB_MPOOLFILE Handle | Next

## DB_ENV->memp_trickle()

    #include <db.h>

    int
    DB_ENV->memp_trickle(DB_ENV *env, int percent, int *nwrotep);

The `DB_ENV->memp_trickle()` method ensures that a specified percent of the pages in the cache are clean, by writing dirty pages to their backing files.

The purpose of the `DB_ENV->memp_trickle()` function is to enable a memory pool manager to ensure that a page is always available for reading in new information without having to wait for a write.

The `DB_ENV->memp_trickle()` method returns a non-zero error value on failure and 0 on success.

### Parameters

#### nwrotep

The nwrotep parameter references memory into which the number of pages written to reach the specified percentage is copied.

#### percent

The percent parameter is the percent of the pages in the cache that should be clean.

### Errors

The `DB_ENV->memp_trickle()` method may fail and return one of the following non-zero errors: following non-zero errors:

#### EINVAL

An invalid flag value or parameter was specified.

### Class

DB_ENV, DB_MPOOLFILE

### See Also

Memory Pools and Related Methods

Prev | Up | Next
DB_ENV->memp_sync() | Home | DB_ENV->set_cache_max()