We introduce a smooth variance sum associated with a pair of positive definite symmetric integral matrices A_{m x m} and B_{n x n}, where m\geq n. By using the oscillator representation, we give a formula for this variance sum in terms of a smooth sum over the square of a functional evaluated on the B-th Fourier coefficients of the vector-valued holomorphic Siegel modular forms which are Hecke eigenforms and obtained by the theta transfer from O_{A_{m x m}}. By using the Ramanujan bound on the Fourier coefficients of the holomorphic cusp forms, we give a sharp upper bound on this variance when n=1. As applications, we prove a cutoff phenomenon for the probability that a unimodular lattice of dimension m represents a given even number. This gives an optimal upper bound on the sphere packing density of almost all even unimodular lattices. Furthermore, we generalize the result of Bourgain, Rudnick and Sarnak, and also give an optimal bound on the diophantine exponent of the p-integral points on any positive definite d-dimensional quadric, where d\geq 3. This improves the best-known bounds due to Ghosh, Gorodnik, and Nevo into an optimal bound.