Using the generalized finite element method (GFEM) to solve the Helmholtz equation in two dimensions, the error of the corresponding solution differs from the error of the best approximation substantially and this effect increases with higher wave numbers. This non-robust behaviour of the finite element solution is called the pollution effect. In our talk we will show how to design a GFEM for the Helmholtz equation such that pollution effect is minimal.