This paper studies a general dynamic buffer management problem with one buffer inserted between two interacting components. The component to be controlled is assumed to have multiple power modes corresponding to different data processing rates. The overall system is modeled as a hybrid system and the buffer management problem is formulated as an optimal control problem. The objective function of the proposed problem depends on the switching cost and the size of the continuous state space, making its solutions much more challenging. By exploiting some particular features of the proposed problem, the best mode sequence and the optimal switching instants are characterized analytically using some variational approach. Simulation result based on real data shows that the proposed method can save about 60% of energies compared with another heuristic scheme in several typical situations. Key words: Hybrid systems, Optimal control, Dynamic buffer management, Variational method, Low power desig...