As far as I know, a Hilbert space consists of all square-integrable function.
So, $\psi(x)$ defined as $\psi(x)=e^{-x^2} \sin (e^{x^2})$, is in a Hilbert space, because it is square-integrable: $ \int_{-\infty}^{\infty}dx\psi^2(x)= \int_{-\infty}^{\infty}dx e^{-2x^2}\sin^2(e^{x^2})< \int_{-\infty}^{\infty}dx e^{-2x^2}<\infty$
And, when $x \rightarrow \infty$, then the leading term of second derivative is:
$\frac{d^2}{dx^2}\psi(x)\approx x^2 e^{x^2} \sin (e^{x^2})$
Then, $\psi(x)\frac{d^2}{dx^2}\psi(x)\approx x^2 \sin (e^{x^2})$
So, the expectation value of kinetic energy T does not converge: $T(\psi) \approx \int_{-\infty}^{\infty}dx \psi(x)\frac{d^2}{dx^2}\psi(x) \approx \int_{-\infty}^{\infty}dxx^2 = \infty$
(This function seems to be unphysical because it oscillates so fast when x increase.)
Is there a function which does not have expectation value for an operator?, or The definition of Hilbert space is not ‘set of all square-integrable function’?