Home Explore Blog CI



neovim

52th chunk of `runtime/doc/luvref.txt`
f022d71191020e542d7f81b7331e8c21401b9331afb1628c0000000100000fa5

uv.set_process_title({title})                           *uv.set_process_title()*

                Parameters:
                - `title`: `string`

                Sets the title of the current process with the string `title`.

                Returns: `0` or `fail`

uv.get_total_memory()                                    *uv.get_total_memory()*

                Returns the current total system memory in bytes.

                Returns: `number`

uv.get_free_memory()                                      *uv.get_free_memory()*

                Returns the current free system memory in bytes.

                Returns: `number`

uv.get_constrained_memory()                        *uv.get_constrained_memory()*

                Gets the amount of memory available to the process in bytes
                based on limits imposed by the OS. If there is no such
                constraint, or the constraint is unknown, 0 is returned. Note
                that it is not unusual for this value to be less than or
                greater than the total system memory.

                Returns: `number`

uv.get_available_memory()                            *uv.get_available_memory()*

                Gets the amount of free memory that is still available to the
                process (in bytes). This differs from `uv.get_free_memory()`
                in that it takes into account any limits imposed by the OS. If
                there is no such constraint, or the constraint is unknown, the
                amount returned will be identical to `uv.get_free_memory()`.

                Returns: `number`

uv.resident_set_memory()                              *uv.resident_set_memory()*

                Returns the resident set size (RSS) for the current process.

                Returns: `integer` or `fail`

uv.getrusage()                                                  *uv.getrusage()*

                Returns the resource usage.

                Returns: `table` or `fail`
                - `utime` : `table` (user CPU time used)
                  - `sec` : `integer`
                  - `usec` : `integer`
                - `stime` : `table` (system CPU time used)
                  - `sec` : `integer`
                  - `usec` : `integer`
                - `maxrss` : `integer` (maximum resident set size)
                - `ixrss` : `integer` (integral shared memory size)
                - `idrss` : `integer` (integral unshared data size)
                - `isrss` : `integer` (integral unshared stack size)
                - `minflt` : `integer` (page reclaims (soft page faults))
                - `majflt` : `integer` (page faults (hard page faults))
                - `nswap` : `integer` (swaps)
                - `inblock` : `integer` (block input operations)
                - `oublock` : `integer` (block output operations)
                - `msgsnd` : `integer` (IPC messages sent)
                - `msgrcv` : `integer` (IPC messages received)
                - `nsignals` : `integer` (signals received)
                - `nvcsw` : `integer` (voluntary context switches)
                - `nivcsw` : `integer` (involuntary context switches)

uv.getrusage_thread()                                    *uv.getrusage_thread()*
                Gets the resource usage measures for the calling thread.

                Note: Not supported on all platforms. May return `ENOTSUP`.

                On macOS and Windows not all fields are set (the unsupported
                fields are filled with zeroes).

                Returns: `table` or `fail`
                - `utime` : `table` (user CPU time used)
                  - `sec` : `integer`
                  - `usec` : `integer`
                - `stime` : `table` (system CPU time used)
                  - `sec` : `integer`
                  - `usec` : `integer`
                - `maxrss` : `integer` (maximum resident set size)
                - `ixrss` : `integer` (integral shared memory size)
                - `idrss`

Title: Libuv: Memory and Resource Usage Utilities
Summary
This section of the Libuv documentation covers functions related to memory and resource usage. It details `uv.set_process_title` (sets process title), `uv.get_total_memory` (total system memory), `uv.get_free_memory` (free system memory), `uv.get_constrained_memory` (memory available to the process based on OS limits), `uv.get_available_memory` (free memory available to the process, considering OS limits), `uv.resident_set_memory` (resident set size for the current process), `uv.getrusage` (resource usage statistics for the process), and `uv.getrusage_thread` (resource usage for the calling thread, with platform-specific limitations).