Environment makes unnecessary page break

I have a problem with user-defined environments in LaTeX. Even though the content of an environment seems to fit, sometimes LaTeX makes an unneccessary page break after all.

Here is my MWE:

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage[ngerman]{babel}

\usepackage{lmodern}

\newenvironment{testenviron}
{}
{}

\begin{document}
\begin{testenviron}
Irgendein Text\dots

\vspace{17.5cm}

\dots und am Ende eine Formel:
$f(x)=x$
\end{testenviron}
\end{document}

To keep it simple, the environment has an empty pre- and postcode. Furthermore \vspace{17.5cm} stands for any text of this length. But for some inexplicable reason pdfLaTeX puts an empty page after that. So my question is: What I am doing wrong and what I am misunderstanding? If I write the pre- and postcode directly without using environments, no further page appears - that's kinda strange.

-
\enlargethispage{1\baselineskip} solves the problem, but this is not that consistent. –  Josef Oct 21 '12 at 15:26
See en.wikibooks.org/wiki/LaTeX/Customizing_LaTeX#Extra_space . Instead of \newenvironment{testenviron} {} {} use \newenvironment{testenviron} {\noindent\ignorespaces} {\par\noindent\ignorespacesafterend} –  mythealias Oct 21 '12 at 15:29
Thank you, this solves my problem. –  Josef Oct 21 '12 at 15:35