  We study blow-up and quantization phenomena for a sequence of solutions
$(u_k)$ to the prescribed $Q$-curvature problem $$ (-\Delta)^nu_k=
Q_ke^{2nu_k}\quad \text{in }\Omega\subset\mathbb{R}^{2n},\quad
\int_{\Omega}e^{2nu_k}dx\leq C,$$ under natural assumptions on $Q_k$. It is
well-known that, up to a subsequence, either $(u_k)$ is bounded in a suitable
norm, or there exists $\beta_k\to\infty$ such that $ u_k=\beta_k(\varphi+o(1))$
in $\Omega\setminus (S_1\cup S_\varphi)$ for some non-trivial non-positive
$n$-harmonic function $\varphi$ and for a finite set $S_1$, where $S_\varphi$
is the zero set of $\varphi$. We prove quantization of the total curvature
$\int_{\tilde\Omega}Q_ke^{2nu_k}dx$ on the region
$\tilde\Omega\Subset(\Omega\setminus S_\varphi)$. We also consider a non-local
case in dimension three.
