I am trying to understand a particular case of this question.

Let $T$ be an affine scheme of finite type over the ground field C. Let $X \to T$ be a morphism. I'll assume this to be the base change of a smooth and projective variety over C. In particular $X \to T$ is flat and proper.

Let $E$ be a coherent sheaf on $X$, which I do *not* assume to be flat over $T$ (and this is where the problems come in). Fix a number $r$.
If $t \in T$ is a (geometric) point of $T$, let $E_t$ be the pullback to the fibre $X_t$.
I would like to understand what the locus of points in $T$ such that $E_t$ is supported in dimension at most $r$.

In other words, I want to characterise the subfunctor of $T$, taking an affine $U$ to the set of morphisms $U \stackrel{g}{\to} T$, such that the pullback sheaf $g^*E$ is fiberwise supported in dimension at most $r$.

The condition can be phrased with chern characters (or hilbert polynomials I guess), as if $r$ corresponds to codimension $k$ in $X_t$ then I'm looking at the locus where $E_t$ has chern character with zeros in degrees lower than $k$. If $E$ were flat over $T$ then this locus would be open in $T$.

I suspect this condition for general $E$ should be closed or locally closed, but I can't seem to work it out. One thought would be to use the flattening stratification for $E$ and then impose the condition on chern characters, but that isn't really what we want. The other thought would be to take some locus where $E$ itself has support of dimension at most $r + \dim T$. While it is true that, for any $d$, one can split $E$ in $0 \to E_{\leq d} \to E \to F \to 0$, with $E$ support in dimension at most $d$, I'm not sure taking, say, the schematic image of the (schematic) support of $E_{\leq r + \dim T}$ is the right thing.