You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|--enable-prof | Enables heap profiling and the ability to detect leaks.|
15
15
16
-
Using `LD_PRELOAD`. Build the library, configure the malloc configuration with the `prof:true` string, and then use `LD_PRELOAD` to preload the `libjemalloc.so` library. The libprocess `MemoryProfiler` class detects the library automatically and enables the profiling support.
16
+
Using `LD_PRELOAD`. Build the library, configure the malloc configuration with the `prof:true` string, and then use `LD_PRELOAD` to preload the `libjemalloc.so` library. Percona Server for MySQL detects jemalloc with profiling enabled automatically when properly configured.
17
17
18
18
The following is an example of the required commands:
19
19
@@ -40,7 +40,7 @@ To enable jemalloc profiling in a MySQL client, run the following command:
40
40
set global jemalloc_profiling=on;
41
41
```
42
42
43
-
The malloc_stats_totals table returns the statistics, in bytes, of the memory usage. The command takes no parameters and returns the results as a table.
43
+
The `malloc_stats_totals` table provides statistics, in bytes, of the memory usage.
44
44
45
45
The following example commands display this result:
46
46
@@ -55,15 +55,15 @@ SELECT * FROM malloc_stats_totals;
The [malloc_stats](#malloc_stats) table returns the cumulative totals, in bytes, of several statistics per type of arena. The command takes no parameters and returns the results as a table.
66
+
The [malloc_stats](#malloc_stats) table provides cumulative totals, in bytes, of several statistics per allocation size type (small, large, and huge).
67
67
68
68
The following example commands display this result:
69
69
@@ -156,15 +156,15 @@ The current stats for allocations. All measurements are in bytes.
| ALLOCATED | The total amount the application allocated |
159
-
| ACTIVE | The total amount allocated by the application of active pages. A multiple of the page size and this value is greater than or equal to the stats.allocated value. The sum does not include allocator metadata pages and stats.arenas.<i>.pdirty or stats.arenas.<i>.pmuzzy. |
159
+
| ACTIVE | The total amount allocated by the application of active pages. A multiple of the page size and this value is greater than or equal to the stats.allocated value. The sum does not include allocator metadata pages and stats.arenas.[i].pdirty or stats.arenas.[i].pmuzzy. |
160
160
| MAPPED | The total amount in chunks that are mapped by the allocator in active extents. This value does not include inactive chunks. The value is at least as large as the stats.active and is a multiple of the chunk size. |
161
161
| RESIDENT | A maximum number the allocator has mapped in physically resident data pages. All allocator metadata pages and unused dirty pages are included in this value. Pages may not be physically resident if they correspond to demand-zeroed virtual memory that has not yet been touched. This value is a maximum rather than a precise value and is a multiple of the page size. The value is greater than the stats.active.|
162
162
| RETAINED | The amount retained by the virtual memory mappings of the operating system. This value does not include any returned mappings. This type of memory, usually de-committed, untouched, or purged. The value is associated with physical memory and is excluded from mapped memory statistics. |
163
163
| METADATA | The total amount dedicated to metadata. This value contains the base allocations which are used for bootstrap-sensitive allocator metadata structures. Transparent huge pages usage is not included. |
164
164
165
165
## malloc_stats
166
166
167
-
The cumulative number of allocations requested or allocations returned for a running instance.
167
+
The cumulative statistics for allocations and deallocations for a running instance.
@@ -69,4 +69,32 @@ The following example downloads *Percona Server for MySQL* {{release}} release `
69
69
70
70
!!! note
71
71
72
-
When installing packages manually, you must make sure to resolve all dependencies and install any missing packages yourself.
72
+
When installing packages manually, you must make sure to resolve all dependencies and install any missing packages yourself.
73
+
74
+
## When to install jemalloc
75
+
76
+
`jemalloc` is an alternative memory allocator that can improve performance and reduce memory fragmentation in certain scenarios. Consider the following when deciding whether to install `jemalloc`:
77
+
78
+
### Install jemalloc when:
79
+
80
+
* You have high-concurrency workloads with many threads
81
+
82
+
* You experience memory fragmentation issues that impact performance
83
+
84
+
* You run multi-threaded applications that perform frequent memory allocation and deallocation
85
+
86
+
* You want to use [memory profiling features](jemalloc-profiling.md) to investigate memory-related issues.
87
+
88
+
* You observe performance degradation related to memory allocation in your current setup
89
+
90
+
### Do not install jemalloc when:
91
+
92
+
* Your current memory allocator (typically glibc malloc) performs adequately for your workload
93
+
94
+
* You have single-threaded or low-concurrency workloads where jemalloc's benefits are minimal
95
+
96
+
* You encounter compatibility issues with jemalloc in your environment
97
+
98
+
* You need to debug memory issues that may be complicated by using an alternative allocator
99
+
100
+
* Your system is already optimized and stable with the default memory allocator
0 commit comments