Let $X$ be some metric measure space on which Sobolev spaces can be defined in a reasonable way. In many cases, $H^1(X)$ is compactly embedded in $L^2(X)$ (e.g., if $X=\Omega$ is a bounded open set of $\mathbb R^d$), and in that case, $H^1_0(X)$ is of course compactly embedded in $L^2(X)$, too. In many cases, on the other hand, $H^1_0(X)$ is not compactly embedded in $L^2(X)$ (e.g., $X=\Omega=\mathbb R^d_+$), let alone $H^1(X)$.
My question is now, whether structures $X$ are known such that the embedding of $H^1_0(X)$ in $L^2(X)$ is compact but that of $H^1(X)$ is not.