The well known Jeans instability is studied for a viscoelastic gravitational fluid using generalized hydrodynamic equations of motions. It is found that the threshold for the onset of instability appears at higher wavelengths in a viscoelastic medium. Elastic effects playing a role similar to thermal pressure are found to lower the growth rate of the gravitational instability. Such features may manifest themselves in matter constituting dense astrophysical objects. (C) 2011 American Institute of Physics. [doi: 10.1063/1.3526685]