  This paper is concerned with error estimates of the fully discrete
generalized finite element method (GFEM) with optimal local approximation
spaces for solving elliptic problems with heterogeneous coefficients. The local
approximation spaces are constructed using eigenvectors of local eigenvalue
problems solved by the finite element method on some sufficiently fine mesh
with mesh size $h$. The error bound of the discrete GFEM approximation is
proved to converge as $h\rightarrow 0$ towards that of the continuous GFEM
approximation, which was shown to decay nearly exponentially in previous works.
Moreover, even for fixed mesh size $h$, a nearly exponential rate of
convergence of the local approximation errors with respect to the dimension of
the local spaces is established. An efficient and accurate method for solving
the discrete eigenvalue problems is proposed by incorporating the discrete
$A$-harmonic constraint directly into the eigensolver. Numerical experiments
are carried out to confirm the theoretical results and to demonstrate the
effectiveness of the method.
