1Z0-888 · Question #9
Which two options describe how MySQL Server allocates memory?
The correct answer is A. A. Each connection may have its own per-thread memory allocations. D. D. Global memory resources are allocated at server startup. MySQL's memory model has two distinct layers: global memory allocated once at startup (e.g., InnoDB buffer pool, key buffer), and per-thread memory allocated dynamically for each client connection (e.g., sort buffers, join buffers). Option A is correct because each thread - one…
Question
Options
- AA. Each connection may have its own per-thread memory allocations.
- BB. Thread memory is pre-allocated up to thread_cache_size for performance.
- CC. Each thread allocates memory from a global pool.
- DD. Global memory resources are allocated at server startup.
How the community answered
(36 responses)- A94% (34)
- B3% (1)
- C3% (1)
Explanation
MySQL's memory model has two distinct layers: global memory allocated once at startup (e.g., InnoDB buffer pool, key buffer), and per-thread memory allocated dynamically for each client connection (e.g., sort buffers, join buffers). Option A is correct because each thread - one per connection - gets its own independent memory allocations governed by variables like sort_buffer_size. Option D is correct because shared global structures are reserved when the server starts, not on demand.
Why B is wrong: thread_cache_size controls how many threads MySQL holds idle for reuse after a connection closes - it is about thread recycling, not memory pre-allocation. No memory is "pre-reserved" up to that count.
Why C is wrong: Per-thread memory is allocated from the OS allocator independently for each thread. MySQL does not maintain a single managed global pool from which threads carve out their working memory - global and per-thread allocations are entirely separate categories.
Memory tip: Think of two buckets - one filled once at startup (global: buffer pool, caches) and one filled fresh per connection (per-thread: sort, join, read buffers). Startup = global; connection = per-thread. That maps directly to D and A.
Topics
Community Discussion
No community discussion yet for this question.