File: database_unmap.rst

package info (click to toggle)
groonga 9.0.0-1%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 101,496 kB
  • sloc: ansic: 608,707; ruby: 35,042; xml: 23,643; cpp: 10,319; sh: 7,453; yacc: 5,968; python: 3,033; makefile: 2,609; perl: 133
file content (85 lines) | stat: -rw-r--r-- 1,747 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
.. -*- rst -*-

.. highlightlang:: none

.. groonga-command
.. database: commands_database_unmap

.. groonga-command
.. thread_limit 2

``database_unmap``
==================

Summary
-------

.. versionadded:: 5.0.7

``database_unmap`` unmaps already mapped tables and columns in the
database. "Map" means that loading from disk to memory. "Unmap" means
that releasing mapped memory.

.. note::

   Normally, you don't need to use ``database_unmap`` because OS
   manages memory cleverly. If remained system memory is reduced, OS
   moves memory used by Groonga to disk until Groonga needs the
   memory. OS moves unused memory preferentially.

.. caution::

   You can use this command only when :doc:`thread_limit` returns
   ``1``. It means that this command doesn't work with multithreading.

Syntax
------

This command takes no parameters::

  database_unmap

Usage
-----

You can unmap database after you change the max number of threads to
``1``:

.. groonga-command
.. include:: ../../example/reference/commands/database_unmap/usage_success.log
.. thread_limit --max 1
.. database_unmap

If the max number of threads is larger than ``1``, ``database_unmap``
fails:

.. groonga-command
.. include:: ../../example/reference/commands/database_unmap/usage_failure.log
.. thread_limit --max 2
.. database_unmap

Parameters
----------

This section describes all parameters.

Required parameters
^^^^^^^^^^^^^^^^^^^

There is no required parameter.

Optional parameters
^^^^^^^^^^^^^^^^^^^

There is no optional parameter.

Return value
------------

The command returns ``true`` as body on success such as::

  [HEADER, true]

If the command fails, error details are in ``HEADER``.

See :doc:`/reference/command/output_format` for ``HEADER``.