See the following code. The first two frame contents (first one code, second one image) do not produce any overfull vbox message.
\documentclass{beamer}
\usepackage{filecontents}
\usepackage{listings}
\lstset{
language=XML,
basicstyle=\small
}
\begin{document}
\begin{filecontents}{\jobname code.xml}
<document>
<part>
<chapter>
<section>
<subsection>
<subsubsection>
<paragraph>
text
</paragraph>
</subsubsection>
</subsection>
</section>
</chapter>
</part>
</document>
\end{filecontents}
\def\putcode{\begin{center}\lstinputlisting{\jobname code.xml}\end{center}}
\def\putimage{\begin{center}\rule{0.9\textwidth}{0.8\textheight}\end{center}}
\begin{frame}
\putcode
\end{frame}
\begin{frame}
\putimage
\end{frame}
\begin{frame}
\begin{overprint}
\onslide<+>
\putcode
\onslide<+>
\putcode
\end{overprint}
\end{frame}
\begin{frame}
\begin{overprint}
\onslide<+>
\putimage
\onslide<+>
\putimage
\end{overprint}
\end{frame}
\begin{frame}
\begin{overprint}
\onslide<+>
\putcode
\onslide<+>
\putimage
\end{overprint}
\end{frame}
\end{document}
When you compile the code, you will be able to readily see that, no overfull message is generated when code is overlaid over code, or an image is overlaid over an image.
But for the last overlay, image over code, we get an overfull vbox message (one for each slide).
Overfull \vbox (187.1715pt too high) detected at line 68
While I can decide to ignore the message, that is not sufficient, because the image gets moved upward (by the overfull amount?), in a rather awkward manner.
I understand that the situation can be remedied by a \vspace
command or something like that, but I would really like to understand the reason.