2. In the Cartesian coordinate system $x O y$, the minimum distance from a moving point $P$ on the graph of the function $y=\frac{1}{2 x}$ to the origin $O$ is ( ).
(A) $\frac{1}{2}$
(B) $\frac{\sqrt{2}}{2}$
(C) 1
(D) $\sqrt{2}$
2. C.

According to the symmetry, we only need to consider the case where $x>0$.
Let the moving point be $P(x, y)$. Then $x y=\frac{1}{2}$.
Also, $x^{2}+y^{2}=(x-y)^{2}+2 x y=(x-y)^{2}+1$, so
when $x=y=\frac{\sqrt{2}}{2}$, $x^{2}+y^{2}$ reaches its minimum value of 1, at which point, $O P$ $=\sqrt{x^{2}+y^{2}}$ has its minimum value of 1.