2. Let $A$ be the set of values of $m$ for which the roots of the equation in $x$
$$
2(m+1) x^{2}-\left(m^{2}+m+16\right) x+8 m=0
$$

are both integers. Then $|A|=$
$\qquad$ .
2. 2 .

If $m=-1$, then $x=-\frac{1}{2}$, which does not meet the requirement. If $m \neq-1$, then we can get $x_{1}=\frac{m}{2}, x_{2}=\frac{8}{m+1}$. According to the problem, $m$ is an even number, and $(m+1) \mid 8$, so $m=0$ or -2.
Therefore, $|A|=2$.