It seems like the sum $S(n)$ should be possible to upperbound by an expression of the form ${\mathcal O}(n^a\cdot \log^b(n))$ as $n \rightarrow \infty$: $$ S(n)\stackrel{\triangle}{=}\sum_{1\leq x \neq y\leq n} \frac{gcd(x,y)^2}{x y}. $$ Any pointers, ideas, appreciated. Since $gcd(x,y) \leq \min(x,y)$ an upper bound is given by $$ S(n) \leq \sum_{1\leq x \neq y\leq n} \frac{\min(x,y)^2}{x y} = 2 \sum_{1\leq x < y\leq n} \frac{x}{y} $$ which can be rewritten as $$ S(n) \leq 2 \sum_{1\leq x \leq n-1} x \sum_{x+1 \leq y \leq n} \frac{1}{y} = 2 \sum_{1\leq x \leq n-1} x (H(n)-H(x)), $$ where $H(n)$ denotes the harmonic sum. This then gives $$ S(n) \leq 2 H(n) \left[\sum_{1\leq x \leq n-1} x\right] -2 \left[\sum_{1\leq x \leq n-1} x H(x)\right] $$ or $$ S(n) \leq n(n-1) H(n) - 2 (1\times H(1)+2 \times H(2)+\cdots+(n-1) \times H(n-1)) $$ or to a first order approximation $$ S(n) \leq n(n-1) H(n) - 2 \sum_{1\leq x \leq n-1} x \log x \approx n^2 \log n - 2 (1+\sum_{2\leq x \leq n-1} x \log x) . $$ An application of the arithmetic geometric mean inequality an Stirling seems to give an estimate of $(n-1)^2$ for the subtracted sum while an integral approximation says that the subtracted sum is ${\cal O}(n^2 \log n)$ which would cancel the first term! Using the estimate $\log n + \gamma$ for the Harmonic sum then leaves us with $S(n) \leq \gamma n(n-1).$

Is there a more accurate estimate?