Global buffers such as the InnoDB buffer pool are allocated after the server starts, and are never freed
Thread buffers are allocated when a client connects, and are freed when the client disconnects
Buffers that are needed for certain operation are allocated when the operation starts, and freed when it ends
User buffers are allocated at server startup and freed when the user is dropped
All dynamic buffers that are set with a SET GLOBAL statement immediately get allocated globally, and are never freed