3. Let $\theta \in$
$\left(0, \frac{\pi}{2}\right)$, then the maximum value of $\frac{2 \sin \theta \cos \theta}{(\sin \theta+1)(\cos \theta+1)}$ is $\qquad$.
Solve:
$$
\frac{2 \sin \theta \cos \theta}{(\sin \theta+1)(\cos \theta+1)}=\frac{2 \sin \theta \cos \theta}{\sin \theta \cos \theta+\sin \theta+\cos \theta+1},
$$

Let $t=\sin \theta+\cos \theta=\sqrt{2} \sin \left(\theta+\frac{\pi}{4}\right) \in(1, \sqrt{2}]$, then $\sin \theta \cos \theta=\frac{t^{2}-1}{2}$,
$$
\text { Original expression }=\frac{t^{2}-1}{\frac{t^{2}-1}{2}+t+1}=\frac{2\left(t^{2}-1\right)}{(t+1)^{2}}=\frac{2(t-1)}{t+1}=2-\frac{4}{t+1} \leqslant 2-\frac{4}{\sqrt{2}+1}=6-4 \sqrt{2} \text {, }
$$

Equality holds if and only if $\theta=\frac{\pi}{4}$.